Public report of sameerasw/essentials, published 16 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, 16 November 2026, 17:08 UTC · Survey ID cd_588e2f45bf584c00bd25accacf0401dc
sameerasw/essentials
Measured 16 November 2026, 17:07 UTC, at code version 5fee3fd
First survey, so nothing to compare with yet
CAI scoreAdequate
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 large codebase: 194,730 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 1.6 person-years · Weakest lens: Production Readiness, 30.1
Findings by how serious they are
16 critical1502 serious87 minor
12 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
16 November 2026, 17:07 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 ▸
53of 53 dimensions measured by tools.
1594of 1605 findings point to an exact file and line, so you can open each one in the code. The other 11 concern the repository as a whole, such as missing documentation.
53dimensions across 7 lenses, read from 194,730 lines of product code in 5 projects.
sameerasw/essentials falls short of our standard for production because we found no logging, tracing or health checks in the code and no automated security scanning of the code, its secrets or its dependencies. It scores 50.1 out of 100 and is rated Adequate, and all 16 of its critical findings are security problems.
Production Readiness, at 30.1, is the weakest lens and counts most in the score. The best first steps are adding a diagnostic log and adding automated security scanning, each worth about 7.9 points. Raising Production Readiness to 70 would lift the score to about 65.0.
Twelve pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. One pipeline step puts outside input straight into a shell command, so an attacker can run commands in the build pipeline. Pinning each tool to an exact version and passing outside input through environment variables would close both risks. Giving the pull-request workflow read-only access would fix the pipeline that outsiders can trigger with write access, and fixing the weaknesses the scanner points to would deal with the security weakness in the code.
The product code is 194,730 lines, about €230,000 to rebuild. The check for the health of its packages couldn't finish, so that result is missing, not a clean pass.
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 30.1 to 70, the lowest score rated Strong, the score would rise from 50.1 to about 65.0.
Code composition: what the lines of code are
Product code 98%Tests 2%
Rebuild cost: about €230,000 · Estimate
Cost to rebuild
€77,000 to €390,000, for 1,281 to 4,064 hours of work, about 1.6 person-years for 1 to 4 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 50. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 194,730 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
Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag.
Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
Raises the score by about 7.9 points · Medium effort · Observability
2
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Raises the score by about 3.7 points · Medium effort · DR & Backup
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €230,000 to build again, about 1.6 person-years of work. Its weakest lens is Production Readiness, at 30.1 (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
Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Of all the actions in this report, it raises the score most for the work it takes: about 7.9 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 15% on every change. The history of the code shows how much it changes: about 285,033 lines over the last 90 days, which is about 1,155,967 lines a year. At that pace, the extra work comes to an estimated 186.6 to 1119.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
396 modules, with 432 dependencies between them. 4 loops run through 24 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 356 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.
domain.diy uses domain.diy.Automation, so a change to domain.diy.Automation can break domain.diy, while a change to domain.diy can't break domain.diy.Automation.
Position
Below the diagonal: domain.diy uses a module listed above it, which is the healthy direction.
9→19 domain.model.PixelSearchResultItem uses domain.modelpart of a loop✕
Connections
8 pairs of types, where a type in domain.model.PixelSearchResultItem uses a type in domain.model.
domain.model.PixelSearchResultItem uses domain.model, so a change to domain.model can break domain.model.PixelSearchResultItem, while a change to domain.model.PixelSearchResultItem can't break domain.model.
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.
10→17 island.state uses island.modelpart of a loop✕
Connections
9 pairs of types, where a type in island.state uses a type in island.model.
domain.diy.Action uses utils.battery, so a change to utils.battery can break domain.diy.Action, while a change to domain.diy.Action can't break utils.battery.
Position
Below the diagonal: domain.diy.Action uses a module listed above it, which is the healthy direction.
70 pairs of types, where a type in domain.diy.Action uses a type in domain.diy. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
domain.diy.Action uses domain.model, so a change to domain.model can break domain.diy.Action, while a change to domain.diy.Action can't break domain.model.
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.
services.automation.modules uses domain.diy, so a change to domain.diy can break services.automation.modules, while a change to services.automation.modules can't break domain.diy.
Position
Below the diagonal: services.automation.modules uses a module listed above it, which is the healthy direction.
ui.core.sheets uses domain.diy.Automation, so a change to domain.diy.Automation can break ui.core.sheets, while a change to ui.core.sheets can't break domain.diy.Automation.
Position
Below the diagonal: ui.core.sheets uses a module listed above it, which is the healthy direction.
ui.core.sheets uses domain.watermark, so a change to domain.watermark can break ui.core.sheets, while a change to ui.core.sheets can't break domain.watermark.
Position
Below the diagonal: ui.core.sheets uses a module listed above it, which is the healthy direction.
ui.core.sheets uses domain.model.PixelSearchResultItem, so a change to domain.model.PixelSearchResultItem can break ui.core.sheets, while a change to ui.core.sheets can't break domain.model.PixelSearchResultItem.
Position
Below the diagonal: ui.core.sheets uses a module listed above it, which is the healthy direction.
ui.core.sheets uses domain.diy.Action, so a change to domain.diy.Action can break ui.core.sheets, while a change to ui.core.sheets can't break domain.diy.Action.
Position
Below the diagonal: ui.core.sheets uses a module listed above it, which is the healthy direction.
13→18 ui.core.sheets uses viewmodelspart of a loop✕
Connections
10 pairs of types, where a type in ui.core.sheets uses a type in viewmodels.
island.gestures uses data.repository, so a change to data.repository can break island.gestures, while a change to island.gestures can't break data.repository.
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.
viewmodels uses domain.model.github, so a change to domain.model.github can break viewmodels, while a change to viewmodels can't break domain.model.github.
Position
Below the diagonal: viewmodels uses a module listed above it, which is the healthy direction.
domain.controller uses domain.model, so a change to domain.model can break domain.controller, while a change to domain.controller can't break domain.model.
Position
Below the diagonal: domain.controller uses a module listed above it, which is the healthy direction.
20→25 domain.controller uses data.repositorypart of a loop✕
Connections
1 pair of types, where a type in domain.controller uses a type in data.repository.
domain.controller uses data.repository, so a change to data.repository can break domain.controller, while a change to domain.controller can't break data.repository.
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.
data.repository uses domain.model.github, so a change to domain.model.github can break data.repository, while a change to data.repository can't break domain.model.github.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in data.repository uses a type in domain.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
data.repository uses domain.controller, so a change to domain.controller can break data.repository, while a change to data.repository can't break domain.controller.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
data.repository uses ui.core.pickers, so a change to ui.core.pickers can break data.repository, while a change to data.repository can't break ui.core.pickers.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
ui.features.system uses domain.diy, so a change to domain.diy can break ui.features.system, while a change to ui.features.system can't break domain.diy.
Position
Below the diagonal: ui.features.system uses a module listed above it, which is the healthy direction.
ui.features.system uses domain.diy.Action, so a change to domain.diy.Action can break ui.features.system, while a change to ui.features.system can't break domain.diy.Action.
Position
Below the diagonal: ui.features.system uses a module listed above it, which is the healthy direction.
42 pairs of types, where a type in ui.features.system uses a type in viewmodels. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
ui.features.system uses viewmodels, so a change to viewmodels can break ui.features.system, while a change to ui.features.system can't break viewmodels.
Position
Below the diagonal: ui.features.system uses a module listed above it, which is the healthy direction.
ui.features.system uses domain.model, so a change to domain.model can break ui.features.system, while a change to ui.features.system can't break domain.model.
Position
Below the diagonal: ui.features.system uses a module listed above it, which is the healthy direction.
ui.features.system uses domain.registry, so a change to domain.registry can break ui.features.system, while a change to ui.features.system can't break domain.registry.
Position
Below the diagonal: ui.features.system uses a module listed above it, which is the healthy direction.
com.sameerasw.essentials uses viewmodels, so a change to viewmodels can break com.sameerasw.essentials, while a change to com.sameerasw.essentials can't break viewmodels.
Position
Below the diagonal: com.sameerasw.essentials uses a module listed above it, which is the healthy direction.
com.sameerasw.essentials uses domain.model, so a change to domain.model can break com.sameerasw.essentials, while a change to com.sameerasw.essentials can't break domain.model.
Position
Below the diagonal: com.sameerasw.essentials uses a module listed above it, which is the healthy direction.
com.sameerasw.essentials uses data.repository, so a change to data.repository can break com.sameerasw.essentials, while a change to com.sameerasw.essentials can't break data.repository.
Position
Below the diagonal: com.sameerasw.essentials uses a module listed above it, which is the healthy direction.
island.plugins uses data.repository, so a change to data.repository can break island.plugins, while a change to island.plugins can't break data.repository.
Position
Below the diagonal: island.plugins uses a module listed above it, which is the healthy direction.
island.service uses island.gestures, so a change to island.gestures can break island.service, while a change to island.service can't break island.gestures.
Position
Below the diagonal: island.service uses a module listed above it, which is the healthy direction.
island.service uses data.repository, so a change to data.repository can break island.service, while a change to island.service can't break data.repository.
Position
Below the diagonal: island.service uses a module listed above it, which is the healthy direction.
services.handlers uses domain.diy.Action, so a change to domain.diy.Action can break services.handlers, while a change to services.handlers can't break domain.diy.Action.
Position
Below the diagonal: services.handlers uses a module listed above it, which is the healthy direction.
services.handlers uses domain.model, so a change to domain.model can break services.handlers, while a change to services.handlers can't break domain.model.
Position
Below the diagonal: services.handlers uses a module listed above it, which is the healthy direction.
services.handlers uses ui.core.pickers, so a change to ui.core.pickers can break services.handlers, while a change to services.handlers can't break ui.core.pickers.
Position
Below the diagonal: services.handlers uses a module listed above it, which is the healthy direction.
services.handlers uses data.repository, so a change to data.repository can break services.handlers, while a change to services.handlers can't break data.repository.
Position
Below the diagonal: services.handlers uses a module listed above it, which is the healthy direction.
ui.activities uses domain.diy.Automation, so a change to domain.diy.Automation can break ui.activities, while a change to ui.activities can't break domain.diy.Automation.
Position
Below the diagonal: ui.activities uses a module listed above it, which is the healthy direction.
ui.activities uses domain.model.PixelSearchResultItem, so a change to domain.model.PixelSearchResultItem can break ui.activities, while a change to ui.activities can't break domain.model.PixelSearchResultItem.
Position
Below the diagonal: ui.activities uses a module listed above it, which is the healthy direction.
ui.activities uses data.repository, so a change to data.repository can break ui.activities, while a change to ui.activities can't break data.repository.
Position
Below the diagonal: ui.activities uses a module listed above it, which is the healthy direction.
island.plugins.calendar uses utils, so a change to utils can break island.plugins.calendar, while a change to island.plugins.calendar can't break utils.
Position
Below the diagonal: island.plugins.calendar uses a module listed above it, which is the healthy direction.
island.plugins.calendar uses island.model, so a change to island.model can break island.plugins.calendar, while a change to island.plugins.calendar can't break island.model.
Position
Below the diagonal: island.plugins.calendar uses a module listed above it, which is the healthy direction.
island.plugins.calendar uses ui.core.pickers, so a change to ui.core.pickers can break island.plugins.calendar, while a change to island.plugins.calendar can't break ui.core.pickers.
Position
Below the diagonal: island.plugins.calendar uses a module listed above it, which is the healthy direction.
island.plugins.calendar uses island.plugins, so a change to island.plugins can break island.plugins.calendar, while a change to island.plugins.calendar can't break island.plugins.
Position
Below the diagonal: island.plugins.calendar uses a module listed above it, which is the healthy direction.
island.plugins.call uses island.model, so a change to island.model can break island.plugins.call, while a change to island.plugins.call can't break island.model.
Position
Below the diagonal: island.plugins.call uses a module listed above it, which is the healthy direction.
island.plugins.call uses island.plugins, so a change to island.plugins can break island.plugins.call, while a change to island.plugins.call can't break island.plugins.
Position
Below the diagonal: island.plugins.call uses a module listed above it, which is the healthy direction.
island.plugins.media uses island.model, so a change to island.model can break island.plugins.media, while a change to island.plugins.media can't break island.model.
Position
Below the diagonal: island.plugins.media uses a module listed above it, which is the healthy direction.
island.plugins.media uses island.plugins, so a change to island.plugins can break island.plugins.media, while a change to island.plugins.media can't break island.plugins.
Position
Below the diagonal: island.plugins.media uses a module listed above it, which is the healthy direction.
island.plugins.navigation uses island.model, so a change to island.model can break island.plugins.navigation, while a change to island.plugins.navigation can't break island.model.
Position
Below the diagonal: island.plugins.navigation uses a module listed above it, which is the healthy direction.
island.plugins.navigation uses domain.model, so a change to domain.model can break island.plugins.navigation, while a change to island.plugins.navigation can't break domain.model.
Position
Below the diagonal: island.plugins.navigation uses a module listed above it, which is the healthy direction.
island.plugins.navigation uses island.plugins, so a change to island.plugins can break island.plugins.navigation, while a change to island.plugins.navigation can't break island.plugins.
Position
Below the diagonal: island.plugins.navigation uses a module listed above it, which is the healthy direction.
island.remote uses data.repository, so a change to data.repository can break island.remote, while a change to island.remote can't break data.repository.
Position
Below the diagonal: island.remote uses a module listed above it, which is the healthy direction.
services.tiles uses data.repository, so a change to data.repository can break services.tiles, while a change to services.tiles can't break data.repository.
Position
Below the diagonal: services.tiles uses a module listed above it, which is the healthy direction.
services.tiles uses island.service, so a change to island.service can break services.tiles, while a change to services.tiles can't break island.service.
Position
Below the diagonal: services.tiles uses a module listed above it, which is the healthy direction.
services.tiles uses services.handlers, so a change to services.handlers can break services.tiles, while a change to services.tiles can't break services.handlers.
Position
Below the diagonal: services.tiles uses a module listed above it, which is the healthy direction.
island.plugins.brief uses island.state, so a change to island.state can break island.plugins.brief, while a change to island.plugins.brief can't break island.state.
Position
Below the diagonal: island.plugins.brief uses a module listed above it, which is the healthy direction.
island.plugins.brief uses island.model, so a change to island.model can break island.plugins.brief, while a change to island.plugins.brief can't break island.model.
Position
Below the diagonal: island.plugins.brief uses a module listed above it, which is the healthy direction.
island.plugins.brief uses data.repository, so a change to data.repository can break island.plugins.brief, while a change to island.plugins.brief can't break data.repository.
Position
Below the diagonal: island.plugins.brief uses a module listed above it, which is the healthy direction.
island.plugins.brief uses island.plugins, so a change to island.plugins can break island.plugins.brief, while a change to island.plugins.brief can't break island.plugins.
Position
Below the diagonal: island.plugins.brief uses a module listed above it, which is the healthy direction.
island.plugins.brief uses island.plugins.media, so a change to island.plugins.media can break island.plugins.brief, while a change to island.plugins.brief can't break island.plugins.media.
Position
Below the diagonal: island.plugins.brief uses a module listed above it, which is the healthy direction.
services.widgets uses domain.model, so a change to domain.model can break services.widgets, while a change to services.widgets can't break domain.model.
Position
Below the diagonal: services.widgets uses a module listed above it, which is the healthy direction.
services.widgets uses data.repository, so a change to data.repository can break services.widgets, while a change to services.widgets can't break data.repository.
Position
Below the diagonal: services.widgets uses a module listed above it, which is the healthy direction.
services.widgets uses island.plugins.media, so a change to island.plugins.media can break services.widgets, while a change to services.widgets can't break island.plugins.media.
Position
Below the diagonal: services.widgets uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 57.2 · Adequate · gated by D1, D2, X3 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
36
High / Critical
A03:2025 — Software Supply Chain Failures
8
High / Critical
Roadmap
Top priorities: Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce; Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing; Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
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 — 16
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 — 1502
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 — 87
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 12
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
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 53 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 — 53 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, 1594 of 1605 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: no test result was produced. 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. This repository's dependency manifests WERE read and their pinning discipline assessed; what went unanswered is the currency half, because api.foojay.io — the registry that answers it — was asked and did not reply (the build stopped because api.foojay.io, a repository this project declares, refused it with HTTP 403 — what this scan's egress allowlist returns for a host that is not on it, so the dependency graph was not resolved). This is OUR side and it is an ENVIRONMENT fault, not a missing collector: the collector exists and ran. An HTTP 403 here is what this scan's egress allowlist returns for a host that is not on it, so the remedy is to add api.foojay.io to the allowlist and re-run — not to build anything.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (197 contributor(s) across 9289 commit(s) sampled, automation and bot accounts excluded). One of them holds 89% of the history; the other 196 hold 0.1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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: it declares a published package (stub/build.gradle.kts), but 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.
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/sameerasw/essentials/domain/diy/SystemMetricTracker.kt`, `app/src/main/java/com/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt`, `app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt`, `app/src/main/java/com/sameerasw/essentials/island/plugins/caffeinate/CaffeinatePlugin.kt`, `app/src/main/java/com/sameerasw/essentials/island/plugins/navigation/NavigationPlugin.kt`, … (+11 more) 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: ements ({languageVersion=21, vendor=Amazon Corretto, implementation=vendor-specific, nativeImageCapable=false}) from 'https://api.foojay.io/disco/v3.0/ids/454b2f35f06b635aa4a2871eddd1e32e/redirect', d…; 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 — 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. The frontend declares that it computes whether a construction is produced or passed, yet 1589 of 1591 constructions arrived without the answer. Arm two skipped them; it did not clear them.
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 this repository's Kotlin is most of its product and 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 this repository's Kotlin is most of its product and 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.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 44 further occurrence(s) are not listed individually; the score already reflects all 84.
X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 554 further occurrence(s) are not listed individually; the score already reflects all 594.
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 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
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.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
162 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was IslandRootKt.IslandRootContent at 438. A further 5 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being SetVolumeSettingsSheetKt.SetVolumeSettingsSheet at 25 — they are counted neither in the figure above nor in this dimension's score. 3 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt (SetVolumeSettingsSheetKt.SetVolumeSettingsSheet at 25), app/src/main/java/com/sameerasw/essentials/island/plugins/signal/SignalPlugin.kt (SignalPlugin.modeLabel at 20), app/src/main/java/com/sameerasw/essentials/utils/BluetoothDeviceIcons.kt (BluetoothDeviceIcons.auto at 20). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 157 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with IslandRootKt.IslandRootContent (cyclomatic 438), FeatureSettingsActivityKt.FeatureSettingsScreen (cyclomatic 281). — 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 2 together lifts Cyclomatic Complexity from 3.8 to about 4.6/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.
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.
+ 242 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 240 down to 240 or less in Cognitive Complexity — start with IslandRootKt.IslandRootContent (cognitive 695), KeyboardInputViewKt.KeyboardInputView (cognitive 514), AutomationEditorActivityKt.AutomationEditorScreen (cognitive 273). — 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 3 together lifts Cognitive Complexity from 2.0 to about 2.7/10, projected with the scoring formula itself and assuming each lands exactly at 240; 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 Classes5.6 / 10Adequate✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 169 MethodTooLong finding(s) in God Classes — start with WelcomeScreen.kt (4), IslandSubSettingsUI.kt (3), FloatingWithFragment.kt (2). — One of this dimension's main actionable groups (169 warning-level).
Resolve the 52 FileTooLong finding(s) in God Classes — start with MainViewModel.kt, SettingsRepository.kt, FeatureRegistry.kt. — One of this dimension's main actionable groups (52 warning-level).
Resolve the 21 ClassTooLong finding(s) in God Classes — start with MainViewModel.kt, SettingsRepository.kt, NotificationListener.kt. — One of this dimension's main actionable groups (21 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
463 duplicated block group(s) detected. 10.0 % of the production lines (19,472 of 194,730) are in a reported copy. A further 143 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 1 of the 606 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 216 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 32 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with NotificationListener.kt (3), SetupFeatures.kt (3), AmbientDreamService.kt (2). — One of this dimension's main actionable groups (32 warning-level).
Resolve the 26 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with AodWallpaperOverlayHandler.kt (2), SetupFeatures.kt (2), NotificationLightingSettingsUI.kt (2). — One of this dimension's main actionable groups (26 warning-level).
Resolve the 18 Duplicated block (17 lines × 2) finding(s) in Code Duplication — start with SetupFeatures.kt (2), AmbientDreamService.kt, DuoTouchHandler.kt. — One of this dimension's main actionable groups (18 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.4 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
5 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; 1 module(s) off the main sequence.
Off the main sequence: :island-sdk
What to do
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with MainViewModel.kt, WatchViewModel.kt. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 16 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 6 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. 6 further coordinate(s) are declared with no version at the declaration site — inherited from a parent POM, a BOM or an unresolved Gradle version reference — and are NOT graded: this verdict covers what the checkout pins, not the full transitive graph. A further 43 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.
Top hotspots: app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt (123×438=53874); app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt (71×281=19951); app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt (270×38=10260) Repeated repair below the complexity floor: app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt (6 of 8 changes were fixes); app/src/main/java/com/sameerasw/essentials/utils/media/AppVolumeController.kt (6 of 7 changes were fixes); app/src/main/java/com/sameerasw/essentials/island/plugins/signal/SignalPlugin.kt (5 of 7 changes were fixes)
Resolve the 111 Hotspot finding(s) in Churn × Complexity Hotspots — start with IslandRoot.kt, FeatureSettingsActivity.kt, MainViewModel.kt. — One of this dimension's main actionable groups (111 warning-level).
Resolve the 8 Repeated repair finding(s) in Churn × Complexity Hotspots — start with ShellUtils.kt, AppVolumeController.kt, SignalPlugin.kt. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d15_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.
0 deducted task-comment markers across 194730 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.
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. 13 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.
1 of 5 build units (Gradle) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesionapp/build.gradle.kts:1
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with build.gradle.kts. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
29 % of calls cross a namespace and 0 % 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: Secret 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.
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).
36 finding(s): 0 critical, 15 high, 21 medium, 0 low. 12 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 2 file(s) — `app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt` (line 194), `gradlew` (line 74, line 178) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 12 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (12 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 624 of the 843 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.
Resolve the 22 Change coupling finding(s) in Change Coupling — start with MainActivity.kt (2), ActionRegistry.kt, IslandMotion.kt. — One of this dimension's main actionable groups (22 warning-level).
Resolve the 10 Change-coupling hub finding(s) in Change Coupling — start with NotificationLightingService.kt, AutomationEditorActivity.kt, BatteriesWidget.kt. — One of this dimension's main actionable groups (10 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
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 4 platform declaration(s) and 66 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 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 the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
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.
Other · Architecture — Whether feature slices stay independent (no direct cross-slice references) — the discipline that makes vertical-slice architecture pay off.
Method: Roslyn scan (vertical-slice gated): feature slices resolved from namespaces (.Features.*, .Slices.*) or project names; cross-slice type references detected. Deterministic, traceable.
Do you agree with this assessment?
DM10 · One transaction, one aggregate10.0 / 10Exemplary○ Nothing flagged
Other · Domain Modelling — Whether a single operation mutates more than one aggregate root. An aggregate is a consistency boundary, so saving two together fuses them into one — the second's invariants come to depend on the first's transaction, and the pair can no longer be separated. Reads of other aggregates are not counted.
Method: Neutral body surface (DDD-gated): every method body scanned for repository WRITE calls (Add/Update/Save/Remove/Delete/Insert/Store and their async forms), keyed on the ARGUMENT type rather than the repository type — three `IRepository<T>` writes collapse to one repository but are three distinct aggregates. Reads (Get/Find/Load/Query) are excluded, so loading another aggregate for context never counts. Score is offending methods over methods that write at all. Deterministic.
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.
Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.
Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.
What to do
Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
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) as a CI step. What was searched, so you can tell an absence from a miss: the 7 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:4
`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:166
What to do
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — 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.
Do you agree with this assessment?
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
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 · 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.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · 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/8 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/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:26
`requestDeviceCodeWithWorkflow` 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/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:55
`pollForToken` 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/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:84
`fetchStagedWallpaper` 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/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:29
`fetchMobileHistory` 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/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:84
`fetchCollectionTotalPages` 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/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:119
`fetchCollectionPhotos` 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/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:144
`stageTomorrowWallpaper` 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/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:202
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.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for (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?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×25) — island-sdk-compose/src/main/java/com/sameerasw/island/sdk/compose/IslandSnapshot.kt:24, app/src/main/java/com/sameerasw/essentials/EssentialsApp.kt:55, app/src/main/java/com/sameerasw/essentials/EssentialsApp.kt:60, …
`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. (×5) — island-sdk/src/main/java/com/sameerasw/island/sdk/IslandCodec.kt:21, island-sdk/src/main/java/com/sameerasw/island/sdk/IslandIdentity.kt:20, island-sdk/src/main/java/com/sameerasw/island/sdk/IslandIdentity.kt:30, …
`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. (×10) — app/src/main/java/com/sameerasw/essentials/MainActivity.kt:191, app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:1895, app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:2121, …
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether 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 — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 34 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
Not included — 70 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: this repository's Java imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Kotlin imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads.
AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
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: ements ({languageVersion=21, vendor=Amazon Corretto, implementation=vendor-specific, nativeImageCapable=false}) from 'https://api.foojay.io/disco/v3.0/ids/454b2f35f06b635aa4a2871eddd1e32e/redirect', d…; 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 — ~3036 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 — Dependency currency not established — api.foojay.io did not answer
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 11 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 .java, .kt, .py, 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
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) and a Gradle version catalogue — 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) — 16 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
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) and a Gradle version catalogue — 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
DM11 Constructible invalid state — no entities detected — construction-time invariants not assessable
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 1 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)
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
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@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.
X14 Bypassable address classification — 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 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
X28 Index access outside its own emptiness guard — 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.
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.
MethodTooLong: SettingsActivityKt.SettingsContent app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:169— MethodTooLong — SettingsContent runs 1207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1107 over it, 12.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AutomationEditorActivityKt.AutomationEditorScreen app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:127— MethodTooLong — AutomationEditorScreen runs 1022 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 922 over it, 10.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: FeatureSettingsActivityKt.FeatureSettingsScreen app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:172— MethodTooLong — FeatureSettingsScreen runs 1008 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 908 over it, 10.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MainViewModel.check app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:1940— MethodTooLong — check runs 981 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 881 over it, 9.81× 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: PixelSearchResultsActivityKt.PixelSearchResultsScreen app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:213— MethodTooLong — PixelSearchResultsScreen runs 880 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 780 over it, 8.80× 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: DuoSettingsUIKt.DuoSettingsUI app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:84— MethodTooLong — DuoSettingsUI runs 847 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 747 over it, 8.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NotificationLightingSettingsUIKt.NotificationLightingSettingsUI app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:86— MethodTooLong — NotificationLightingSettingsUI runs 807 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 707 over it, 8.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MainActivity.onCreate app/src/main/java/com/sameerasw/essentials/MainActivity.kt:166— MethodTooLong — onCreate runs 757 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 657 over it, 7.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: FloatingWithFragmentKt.ShortenUrlSheet app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:204— MethodTooLong — ShortenUrlSheet runs 664 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 564 over it, 6.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: LinkPickerAdapterKt.LinkPickerScreen app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:207— MethodTooLong — LinkPickerScreen runs 641 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 541 over it, 6.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BugReportBottomSheetKt.BugReportBottomSheet app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:102— MethodTooLong — BugReportBottomSheet runs 635 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 535 over it, 6.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CombinedActionExecutor.execute REDACTED:164— MethodTooLong — execute runs 630 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 530 over it, 6.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StatusGlanceSettingsUIKt.StatusGlanceSettingsUI app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:82— MethodTooLong — StatusGlanceSettingsUI runs 628 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 528 over it, 6.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PixelSearchbarSettingsActivityKt.PixelSearchbarSettingsUI app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:282— MethodTooLong — PixelSearchbarSettingsUI runs 620 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 520 over it, 6.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FreezeSettingsUIKt.FreezeSettingsUI app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt:79— MethodTooLong — FreezeSettingsUI runs 610 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 510 over it, 6.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WallpaperScreenKt.WallpaperScreen app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt:130— MethodTooLong — WallpaperScreen runs 547 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 447 over it, 5.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IslandSettingsUIKt.IslandSettingsUI app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt:109— MethodTooLong — IslandSettingsUI runs 542 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 442 over it, 5.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StatusBarIconSettingsUIKt.StatusBarIconSettingsUI app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:66— MethodTooLong — StatusBarIconSettingsUI runs 455 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 355 over it, 4.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: ActionSequenceEditorKt.ActionSequenceEditor app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:80— MethodTooLong — ActionSequenceEditor runs 424 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 324 over it, 4.24× 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: PowerAndBatterySettingsUIKt.PowerAndBatterySettingsUI app/src/main/java/com/sameerasw/essentials/ui/features/power/PowerAndBatterySettingsUI.kt:44— MethodTooLong — PowerAndBatterySettingsUI runs 359 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 259 over it, 3.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AmbientGlanceHandler.showOverlay app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:725— MethodTooLong — showOverlay runs 348 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 248 over it, 3.48× 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: WallpaperStagingScreenKt.WallpaperStagingScreen app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperStagingScreen.kt:89— MethodTooLong — WallpaperStagingScreen runs 348 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 248 over it, 3.48× 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: AppUpdatesActivity.onCreate app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:78— MethodTooLong — onCreate runs 343 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 243 over it, 3.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DuoOverlayView.onDraw app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1544— MethodTooLong — onDraw runs 343 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 243 over it, 3.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TravelCompassActivityKt.CompassScreen app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:174— MethodTooLong — CompassScreen runs 333 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 233 over it, 3.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt:204— app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt changed 123 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 438 in IslandRootKt.IslandRootContent at line 204. 19 of those changes were fix/bug commits, and the other 104 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.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/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:172— app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt changed 71 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 281 in FeatureSettingsActivityKt.FeatureSettingsScreen at line 172. 9 of those changes were fix/bug commits, and the other 62 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.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/sameerasw/essentials/viewmodels/MainViewModel.kt app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:1940— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt changed 270 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in MainViewModel.check at line 1940. 18 of those changes were fix/bug commits, and the other 252 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.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: REDACTED REDACTED:164— REDACTED changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 172 in CombinedActionExecutor.execute at line 164. 10 of those changes were fix/bug commits, and the other 35 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:2051— app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt changed 323 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in SettingsRepository.importConfigs at line 2051. 18 of those changes were fix/bug commits, and the other 305 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.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/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:127— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 191 in AutomationEditorActivityKt.AutomationEditorScreen at line 127. 4 of those changes were fix/bug commits, and the other 33 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.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/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt:109— app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt changed 99 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in IslandSettingsUIKt.IslandSettingsUI at line 109. 1 of those changes was a fix/bug commit, and the other 98 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.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/sameerasw/essentials/services/NotificationListener.kt app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:2207— app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt changed 71 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in NotificationListener.extractNotificationAlert at line 2207. 16 of those changes were fix/bug commits, and the other 55 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/services/NotificationListener.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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:84— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 108 in DuoSettingsUIKt.DuoSettingsUI at line 84. 2 of those changes were fix/bug commits, and the other 39 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.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/sameerasw/essentials/ui/activities/SettingsActivity.kt app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:169— app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in SettingsActivityKt.SettingsContent at line 169. 4 of those changes were fix/bug commits, and the other 48 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.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/sameerasw/essentials/island/service/IslandCoordinator.kt app/src/main/java/com/sameerasw/essentials/island/service/IslandCoordinator.kt:1057— app/src/main/java/com/sameerasw/essentials/island/service/IslandCoordinator.kt changed 112 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in IslandCoordinator.onSharedPreferenceChanged at line 1057. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/island/service/IslandCoordinator.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/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:213— app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 145 in PixelSearchResultsActivityKt.PixelSearchResultsScreen at line 213. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.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/sameerasw/essentials/utils/DuoOverlayView.kt app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1544— app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in DuoOverlayView.onDraw at line 1544. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.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/sameerasw/essentials/ui/composables/SetupFeatures.kt app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:96— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in SetupFeaturesKt.SetupFeatures at line 96. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.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/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:816— app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt changed 60 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in DuoOverlayHandler.showOrUpdateOverlay at line 816. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.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/sameerasw/essentials/island/ui/CompactTemplate.kt app/src/main/java/com/sameerasw/essentials/island/ui/CompactTemplate.kt:109— app/src/main/java/com/sameerasw/essentials/island/ui/CompactTemplate.kt changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in CompactTemplateKt.CompactTemplate at line 109. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/island/ui/CompactTemplate.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/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:1126— app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt changed 99 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in ScreenOffAccessibilityService.onStartCommand at line 1126. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.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/sameerasw/essentials/MainActivity.kt app/src/main/java/com/sameerasw/essentials/MainActivity.kt:166— app/src/main/java/com/sameerasw/essentials/MainActivity.kt changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in MainActivity.onCreate at line 166. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/MainActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:1004— app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in IslandSubSettingsUIKt.IslandBehaviorSettingsUI at line 1004. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.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/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:82— app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 90 in StatusGlanceSettingsUIKt.StatusGlanceSettingsUI at line 82. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.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/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:207— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in LinkPickerAdapterKt.LinkPickerScreen at line 207. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.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/sameerasw/essentials/utils/ui/PermissionUIHelper.kt app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt:30— app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 95 in PermissionUIHelper.getPermissionItem at line 30. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.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/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:356— app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt changed 64 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in NotificationsPlugin.onPosted at line 356. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.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/sameerasw/essentials/island/state/IslandController.kt app/src/main/java/com/sameerasw/essentials/island/state/IslandController.kt:346— app/src/main/java/com/sameerasw/essentials/island/state/IslandController.kt changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in IslandController.recompute at line 346. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/island/state/IslandController.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/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:282— app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in PixelSearchbarSettingsActivityKt.PixelSearchbarSettingsUI at line 282. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.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.
FileTooLong: viewmodels/MainViewModel.kt app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt— FileTooLong — 6594 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: MainViewModel (119-10949). The bar is 500 significant lines; this is 6094 over it, 13.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: repository/SettingsRepository.kt app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt— FileTooLong — 2847 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: SettingsRepository (51-4946). The bar is 500 significant lines; this is 2347 over it, 5.69× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: registry/FeatureRegistry.kt app/src/main/java/com/sameerasw/essentials/domain/registry/FeatureRegistry.kt— FileTooLong — 2513 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2013 over it, 5.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: services/NotificationListener.kt app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt— FileTooLong — 1877 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: NotificationListener (71-2634). The bar is 500 significant lines; this is 1377 over it, 3.75× 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: ime/KeyboardInputView.kt app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt— FileTooLong — 1695 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1195 over it, 3.39× 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: ui/IslandRoot.kt app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt— FileTooLong — 1685 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1185 over it, 3.37× 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: utils/DuoOverlayView.kt app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt— FileTooLong — 1461 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: DuoOverlayView (37-2027). The bar is 500 significant lines; this is 961 over it, 2.92× 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: activities/SettingsActivity.kt app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt— FileTooLong — 1361 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 861 over it, 2.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: display/IslandSubSettingsUI.kt app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt— FileTooLong — 1337 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 837 over it, 2.67× 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: activities/PixelSearchResultsActivity.kt app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt— FileTooLong — 1256 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 756 over it, 2.51× 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: activities/AutomationEditorActivity.kt app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt— FileTooLong — 1247 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 747 over it, 2.49× 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: composables/SetupFeatures.kt app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt— FileTooLong — 1188 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 688 over it, 2.38× 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: dreams/AmbientDreamService.kt app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt— FileTooLong — 1177 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: AmbientDreamService (42-1621). The bar is 500 significant lines; this is 677 over it, 2.35× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: activities/FeatureSettingsActivity.kt app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt— FileTooLong — 1172 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 672 over it, 2.34× 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: handlers/AmbientGlanceHandler.kt app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt— FileTooLong — 1156 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: AmbientGlanceHandler (43-1596). The bar is 500 significant lines; this is 656 over it, 2.31× 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: handlers/AodWallpaperOverlayHandler.kt app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt— FileTooLong — 1136 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: AodWallpaperOverlayHandler (69-1553). The bar is 500 significant lines; this is 636 over it, 2.27× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: linkActions/LinkPickerAdapter.kt app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt— FileTooLong — 1102 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 602 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: handlers/DuoOverlayHandler.kt app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt— FileTooLong — 1040 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: DuoOverlayHandler (77-1424). The bar is 500 significant lines; this is 540 over it, 2.08× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: utils/StatusGlanceView.kt app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt— FileTooLong — 1005 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: StatusGlanceView (40-1391). The bar is 500 significant lines; this is 505 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: lighting/NotificationLightingSettingsUI.kt app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt— FileTooLong — 984 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 484 over it, 1.97× 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: REDACTED REDACTED— FileTooLong — 975 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 475 over it, 1.95× 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: tiles/ScreenOffAccessibilityService.kt app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt— FileTooLong — 973 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: ScreenOffAccessibilityService (77-1275). The bar is 500 significant lines; this is 473 over it, 1.95× 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: essentials/MainActivity.kt app/src/main/java/com/sameerasw/essentials/MainActivity.kt— FileTooLong — 966 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: MainActivity (156-1289). The bar is 500 significant lines; this is 466 over it, 1.93× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: linkActions/FloatingWithFragment.kt app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt— FileTooLong — 955 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 455 over it, 1.91× 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/IslandCoordinator.kt app/src/main/java/com/sameerasw/essentials/island/service/IslandCoordinator.kt— FileTooLong — 950 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: IslandCoordinator (108-1173). The bar is 500 significant lines; this is 450 over it, 1.90× 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.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:40— app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:40-50 | app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:67-77 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/data/repository/GitHubRepository.kt:40` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/island/plugins/call/CallExpanded.kt:62— app/src/main/java/com/sameerasw/essentials/island/plugins/call/CallExpanded.kt:62-72 | app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/OtpExpanded.kt:64-74 — 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/sameerasw/essentials/island/plugins/call/CallExpanded.kt:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:770— app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:770-780 | app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:826-836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:770` it does not close everything it opens, so those 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/sameerasw/essentials/services/NotificationListener.kt:448— app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:448-459 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:512-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/sameerasw/essentials/services/NotificationListener.kt:448` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:461— app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:461-471 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:524-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/services/NotificationListener.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 (11 lines × 2) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1187— app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1187-1197 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1701-1711 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/services/NotificationListener.kt:1187` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:325— app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:325-335 | app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:1089-1099 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt:47— app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt:47-57 | app/src/main/java/com/sameerasw/essentials/services/widgets/WidgetScraperService.kt:306-316 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt` and `app/src/main/java/com/sameerasw/essentials/services/widgets/WidgetScraperService.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:303— app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:303-313 | app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.kt:356-366 — 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/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:303` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/components/EssentialsFloatingToolbar.kt:125— app/src/main/java/com/sameerasw/essentials/ui/components/EssentialsFloatingToolbar.kt:125-135 | app/src/main/java/com/sameerasw/essentials/ui/components/EssentialsFloatingToolbar.kt:145-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/components/EssentialsFloatingToolbar.kt:125` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/components/dialogs/RepoDetailsRow.kt:119— app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/RepoDetailsRow.kt:119-129 | app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/RepoDetailsRow.kt:150-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/components/dialogs/RepoDetailsRow.kt:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:239— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:239-249 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:606-616 — both copies are in the same file, so extract the 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:288— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:288-298 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:658-668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:509— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:509-519 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:816-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.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt:52— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt:52-62 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/GlowSidesPicker.kt:48-59 — 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/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt:52` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/apps/StandbyAppsSettingsUI.kt:179— app/src/main/java/com/sameerasw/essentials/ui/features/apps/StandbyAppsSettingsUI.kt:179-189 | app/src/main/java/com/sameerasw/essentials/ui/features/apps/StandbyAppsSettingsUI.kt:327-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/apps/StandbyAppsSettingsUI.kt:179` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:737— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:737-747 | app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt:591-601 — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:737` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:513— app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:513-523 | app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:906-916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:513` it does not close everything it opens, so those 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/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:917` calls `SettingsRepository`, `mutableStateOf`, `isIslandPreferStillEnabled` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:524` 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 × 2) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt:67— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt:67-77 | app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationIconPicker.kt:69-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkPreviewArea.kt:96— app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkPreviewArea.kt:96-106 | app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkPreviewArea.kt:115-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/watermark/components/WatermarkPreviewArea.kt:96` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiPicker.kt:159— app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiPicker.kt:159-169 | app/src/main/java/com/sameerasw/essentials/ui/ime/KaomojiPicker.kt:179-189 — 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/sameerasw/essentials/ui/ime/EmojiPicker.kt:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1620— app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1620-1630 | app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1663-1673 — both copies are in the same file, so extract the 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/sameerasw/essentials/utils/UpdateNotificationHelper.kt:70— app/src/main/java/com/sameerasw/essentials/utils/UpdateNotificationHelper.kt:70-80 | app/src/main/java/com/sameerasw/essentials/utils/UpdateNotificationHelper.kt:114-124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/utils/UpdateNotificationHelper.kt:70` 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1498— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1498-1508 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1473-1483 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:423— app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:423-433 | app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:897-911 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:423` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:1126— app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:1126-1137 | app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:1142-1153 — both copies are in the same file, so extract the 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/sameerasw/essentials/services/WatchNotificationSyncManager.kt:184— app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:184-195 | app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:278-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:290` calls `put`, `add` and `app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:197` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1179— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1179-1190 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:773-784 — 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/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1179` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1204— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1204-1215 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:797-808 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:631— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:631-642 | app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:143-154 — 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/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:631` it does not close everything it opens, so those 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/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:142` calls `EssentialsTheme` and `app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:629` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:863— app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:863-874 | app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:930-941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:863` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:137— app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:137-148 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:177-188 — 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/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:270— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:270-281 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:630-641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:270` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:426— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:426-437 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:749-760 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:426` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/apps/sheets/KeyboardSelectionSheet.kt:93— app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/KeyboardSelectionSheet.kt:93-104 | app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/StandbyAppsMoveSheet.kt:54-65 — 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/sameerasw/essentials/ui/features/apps/sheets/KeyboardSelectionSheet.kt:93` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/audio/NotificationSnoozingSettingsUI.kt:94— app/src/main/java/com/sameerasw/essentials/ui/features/audio/NotificationSnoozingSettingsUI.kt:94-105 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/NotificationSnoozingSettingsUI.kt:127-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/audio/NotificationSnoozingSettingsUI.kt:94` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:189— app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:189-200 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:175-186 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:189` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt:66— app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt:66-77 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt:131-142 — both copies are in the same file, so extract the 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/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt:465— app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt:465-476 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt:529-540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt:465` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:766— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:766-777 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/HorizontalSlideModeSheet.kt:46-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:766` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:269— app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:269-280 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:794-805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:269` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:883— app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:883-894 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:926-937 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:883` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:189— app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:189-200 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:199-210 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:189` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/utils/AppUtil.kt:283— app/src/main/java/com/sameerasw/essentials/utils/AppUtil.kt:283-294 | app/src/main/java/com/sameerasw/essentials/utils/AppUtil.kt:318-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:210— app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:210-221 | app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:269-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/utils/FreezeManager.kt:210` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt:849— app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt:849-860 | app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt:866-877 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/utils/OverlayHelper.kt:849` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/utils/overlay/DashOverlay.kt:86— app/src/main/java/com/sameerasw/essentials/utils/overlay/DashOverlay.kt:86-97 | app/src/main/java/com/sameerasw/essentials/utils/overlay/RippleOverlay.kt:77-88 — 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/sameerasw/essentials/utils/overlay/DashOverlay.kt:86` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:110— app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:110-121 | app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:425-436 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateDnsTileService.kt:36— app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateDnsTileService.kt:36-47 | app/src/main/java/com/sameerasw/essentials/services/tiles/UsbDebuggingTileService.kt:26-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) app/src/main/java/com/sameerasw/essentials/receivers/UrlShortenerActionReceiver.kt:49— app/src/main/java/com/sameerasw/essentials/receivers/UrlShortenerActionReceiver.kt:49-60 | app/src/main/java/com/sameerasw/essentials/receivers/UrlShortenerActionReceiver.kt:74-85 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/receivers/UrlShortenerActionReceiver.kt:49` it begins part-way through the construct above it, so those 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) island-sdk-compose/src/main/java/com/sameerasw/island/sdk/compose/IslandSnapshot.kt:24— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/EssentialsApp.kt:55— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/EssentialsApp.kt:60— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/MainActivity.kt:420— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:724— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:766— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:780— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:854— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4757— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4956— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4970— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:8044— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:8094— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:8168— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:8184— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:8205— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:8217— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:8229— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:8248— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:8269— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:9791— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:9874— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:10115— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:10299— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:10303— 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.
Change coupling: ActionRegistry.kt ↔ REDACTED app/src/main/java/com/sameerasw/essentials/domain/diy/ActionRegistry.kt:1— `app/src/main/java/com/sameerasw/essentials/domain/diy/ActionRegistry.kt` and `REDACTED` change together 100% of the time (21 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 21 shared commits counted here, the most recent 3 are `e5f6420e` feat: add Send notification DIY action; `df1884c1` feat: add back gesture page with edge widths, per-app widths and DIY …; `fe3dca09` feat: add Set Mode automation action to turn system Modes on or off — run `git show` on any of them.
Change coupling: IslandMotion.kt ↔ IslandRoot.kt app/src/main/java/com/sameerasw/essentials/island/ui/IslandMotion.kt:1— `app/src/main/java/com/sameerasw/essentials/island/ui/IslandMotion.kt` and `app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt` change together 100% of the time (11 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `8dc3d310` refactor: refine dynamic island hiding animation and squash physics; `0022fc2a` feat: udpate island secondary bubble expand collapse animations; `e3c7d02b` feat: improve island open animtion — run `git show` on any of them.
Change coupling: PixelSearchbarWidget.kt ↔ PixelSearchbarSettingsActivity.kt app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidget.kt:1— `app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidget.kt` and `app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt` change together 90% of the time (9 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `df793ac2` fix(pixel-searchbar): address review feedback on widget lifecycle, mi…; `05d3778e` feat: search engine results; `874ee6ba` feat: add music playback display option to Pixel Searchbar widget wit… — run `git show` on any of them.
Change coupling: EssentialsInputMethodService.kt ↔ KeyboardSettingsUI.kt app/src/main/java/com/sameerasw/essentials/ime/EssentialsInputMethodService.kt:1— `app/src/main/java/com/sameerasw/essentials/ime/EssentialsInputMethodService.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/KeyboardSettingsUI.kt` change together 80% of the time (12 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `a67a7784` refactor(snippet): remove leftover comments, duplicate listener call …; `bcff600c` refactor(snippet): address review feedback on expansion safety, perfo…; `f5da97cf` feat: #251 Accented characters in keyboard (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/KeyboardSettingsUI.kt`) — run `git show` on any of them.
Change coupling: MainActivity.kt ↔ AppUpdatesActivity.kt app/src/main/java/com/sameerasw/essentials/MainActivity.kt:1— `app/src/main/java/com/sameerasw/essentials/MainActivity.kt` and `app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt` change together 79% of the time (11 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `f5cb03c1` feat: replace console mode with global motion blur setting across all…; `64d668fc` feat: #277 in-app lang picker (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/AppUpdatesActivity.kt`); `7af0d60f` feat: global bottom toolbar design with no top app bars (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/AppUpdatesActivity.kt`) — run `git show` on any of them.
Change coupling: StackHost.kt ↔ WidgetStackConfigureActivity.kt app/src/main/java/com/sameerasw/essentials/services/widgets/StackHost.kt:1— `app/src/main/java/com/sameerasw/essentials/services/widgets/StackHost.kt` and `app/src/main/java/com/sameerasw/essentials/ui/activities/WidgetStackConfigureActivity.kt` change together 77% of the time (10 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `be931f20` fix(widgets): address smart rotation review; `cd274c6d` feat: smart rotation for widget stacks; `85722909` fix(widgets): address smart rotation review — run `git show` on any of them.
Change coupling: IslandPriorityEntries.kt ↔ IslandSettingsUI.kt app/src/main/java/com/sameerasw/essentials/island/model/IslandPriorityEntries.kt:1— `app/src/main/java/com/sameerasw/essentials/island/model/IslandPriorityEntries.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt` change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `322d1dc4` feat: allow changing island time priority; `201e4dad` feat: live updates in island bubbles; `981eb037` feat: remove descriptions and update priority of nav plugin — run `git show` on any of them.
Change coupling: NotificationLightingSettingsUI.kt ↔ OverlayHelper.kt app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:1— `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt` change together 74% of the time (14 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `aa78e838` feat: add Dash notification lighting; `71e74872` refactor: sparkle notification lighting style; `00495916` feat: add ripple edge lighting style — run `git show` on any of them.
Change coupling: AodWallpaperOverlayHandler.kt ↔ AlwaysOnDisplaySettingsUI.kt app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1— `app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt` change together 67% of the time (12 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `8df89d1e` feat: add support for AOD wallpaper timeout, blur, vignette, and blac…; `488d1919` feat: AOD album art always on and app filter; `aa7bfb35` feat: Album art on AOD — run `git show` on any of them.
Change coupling: AmbientGlanceHandler.kt ↔ EssentialsOnDisplaySettingsUI.kt app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1— `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/EssentialsOnDisplaySettingsUI.kt` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `1748338d` refactor: Refactor and optimizations (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/EssentialsOnDisplaySettingsUI.kt`); `02870647` feat: add support to temporarily hide Ambient Glance when new notific… (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/EssentialsOnDisplaySettingsUI.kt`); `8d65a0ad` feat: add option to force Ambient Music Glance to fill mode while cha… (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/EssentialsOnDisplaySettingsUI.kt`) — run `git show` on any of them.
Change coupling: CalendarExpanded.kt ↔ IslandRoot.kt app/src/main/java/com/sameerasw/essentials/island/plugins/calendar/CalendarExpanded.kt:1— `app/src/main/java/com/sameerasw/essentials/island/plugins/calendar/CalendarExpanded.kt` and `app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `473185c6` fix: camera gap affecting padding; `8da593e8` refactor: simplify island surface visuals and remove media artwork co…; `fbdb268a` feat: add resizable card expanded island — run `git show` on any of them.
Change coupling: DeviceInfoSyncManager.kt ↔ WatchfaceSettingsUI.kt app/src/main/java/com/sameerasw/essentials/services/DeviceInfoSyncManager.kt:1— `app/src/main/java/com/sameerasw/essentials/services/DeviceInfoSyncManager.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchfaceSettingsUI.kt` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `e0d8720a` feat: add 24-hour clock setting to watchface configuration; `f3b61217` feat: add flashlight glance complication to watchface settings; `f4c826c8` feat: add setting to toggle complication visibility on Always on Display — run `git show` on any of them.
Change coupling: CompactLayoutEngine.kt ↔ CompactTemplate.kt app/src/main/java/com/sameerasw/essentials/island/state/CompactLayoutEngine.kt:1— `app/src/main/java/com/sameerasw/essentials/island/state/CompactLayoutEngine.kt` and `app/src/main/java/com/sameerasw/essentials/island/ui/CompactTemplate.kt` change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `c76d1b11` fix(island): refine overlap hub sizing and balance space calculation; `80a4a64b` refactor: improve compact layout engine with slack, jitter filtering,…; `5de56fab` refactor: improve compact layout engine with slack, jitter filtering,… — run `git show` on any of them.
Change coupling: BriefPlugin.kt ↔ CalendarExpanded.kt app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:1— `app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt` and `app/src/main/java/com/sameerasw/essentials/island/plugins/calendar/CalendarExpanded.kt` change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `473185c6` fix: camera gap affecting padding; `c25e7950` fix: more missing dynamic color use in island items; `5e034aa3` feat: expand island time formatting to brief — run `git show` on any of them.
Change coupling: LocationReachedService.kt ↔ LocationReachedSettingsUI.kt app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:1— `app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationReachedSettingsUI.kt` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `72b410d6` feat: #569 are we there yet full screen alert; `fff0c048` feat: add icon picker and dynamic notification icons for location alarms (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LocationReachedSettingsUI.kt`); `eb168f43` feat: add ETA calculation to location reached service (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LocationReachedSettingsUI.kt`) — run `git show` on any of them.
Change coupling: AppFreezingActivity.kt ↔ FreezeGridUI.kt app/src/main/java/com/sameerasw/essentials/ui/activities/AppFreezingActivity.kt:1— `app/src/main/java/com/sameerasw/essentials/ui/activities/AppFreezingActivity.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `45b07a30` refactor: reformat code (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/FreezeGridUI.kt`); `93fa88c3` refactor: cleanup freeze activity and add FAB menu (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/FreezeGridUI.kt`); `49cb6c4b` refactor: decouple AppFreezingActivity by delegating UI logic to Free… (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/FreezeGridUI.kt`) — run `git show` on any of them.
Change coupling: NotificationListener.kt ↔ OverlayHelper.kt app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1— `app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt` and `app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt` change together 53% of the time (10 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `aa78e838` feat: add Dash notification lighting; `71e74872` refactor: sparkle notification lighting style; `00495916` feat: add ripple edge lighting style — run `git show` on any of them.
Change coupling: SetupFeatures.kt ↔ FeatureCard.kt app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:1— `app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt` and `app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureCard.kt` change together 52% of the time (21 of the 40 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 21 shared commits counted here, the most recent 3 are `88c7e1f5` feat: 2 pane layout selected state; `81e255a6` feat: add legacy feature support with filtering and tag icons; `8682963a` feat: frozen apps in search results — run `git show` on any of them.
Change coupling: MainActivity.kt ↔ ReusableTopAppBar.kt app/src/main/java/com/sameerasw/essentials/MainActivity.kt:1— `app/src/main/java/com/sameerasw/essentials/MainActivity.kt` and `app/src/main/java/com/sameerasw/essentials/ui/components/ReusableTopAppBar.kt` change together 50% of the time (16 of the 32 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `24b2e506` fix: Top app bar button sizes; `077acd85` feat: Applied standard styling across the app, removed toolbar styling; `5674fe9d` App download and install — run `git show` on any of them.
Change coupling: YourAndroidActivity.kt ↔ DeviceHeroCard.kt app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.kt:1— `app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.kt` and `app/src/main/java/com/sameerasw/essentials/ui/components/DeviceHeroCard.kt` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `dbd84996` refactor: migrate device logo from hero card to collapsible pull titl…; `df227ffa` feat: introduce PullTitleHeader component and integrate main tabs; `1748338d` refactor: Refactor and optimizations — run `git show` on any of them.
Change coupling: FreezeSettingsUI.kt ↔ FreezeManager.kt app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt:1— `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `426ae83c` feat: #245 App suspension (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FreezeSettingsUI.kt`); `717a2f3f` feat #127 : Skip running apps detection for freezing (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FreezeSettingsUI.kt`); `71fbe4ea` Improved auto freezing and freeze buttons (at that commit the file was still `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FreezeSettingsUI.kt`) — run `git show` on any of them.
Change coupling: FeatureSettingsActivity.kt ↔ ScreenOffWidgetSettingsUI.kt app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:1— `app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/tiles/ScreenOffWidgetSettingsUI.kt` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `aecb0000` feat: shizuku permission ahndlign for screen off widget (at that commit the files were still `app/src/main/java/com/sameerasw/essentials/FeatureSettingsActivity.kt` and `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ScreenOffWidgetSettingsUI.kt`); `7de557b0` Initial translation support string extraction (at that commit the files were still `app/src/main/java/com/sameerasw/essentials/FeatureSettingsActivity.kt` and `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ScreenOffWidgetSettingsUI.kt`); `8c8ff2b8` refactor haptic feedback type usage (at that commit the files were still `app/src/main/java/com/sameerasw/essentials/FeatureSettingsActivity.kt` and `app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ScreenOffWidgetSettingsUI.kt`) — run `git show` on any of them.
ClassTooLong: MainViewModel app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:119— ClassTooLong — 6487 significant lines (blank, comment-only and punctuation-only lines excluded), 691 methods. The bar is 400 significant lines; this is 6087 over it, 16.22× 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: SettingsRepository app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:51— ClassTooLong — 2808 significant lines (blank, comment-only and punctuation-only lines excluded), 924 methods. The bar is 400 significant lines; this is 2408 over it, 7.02× 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: NotificationListener app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:71— ClassTooLong — 1818 significant lines (blank, comment-only and punctuation-only lines excluded), 66 methods. The bar is 400 significant lines; this is 1418 over it, 4.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DuoOverlayView app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:37— ClassTooLong — 1436 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 1036 over it, 3.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AmbientDreamService app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:42— ClassTooLong — 1147 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 747 over it, 2.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AmbientGlanceHandler app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:43— ClassTooLong — 1125 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 725 over it, 2.81× 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: AodWallpaperOverlayHandler app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:69— ClassTooLong — 1079 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods. The bar is 400 significant lines; this is 679 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StatusGlanceView app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:40— ClassTooLong — 977 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 577 over it, 2.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DuoOverlayHandler app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:77— ClassTooLong — 975 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods. The bar is 400 significant lines; this is 575 over it, 2.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ScreenOffAccessibilityService app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:77— ClassTooLong — 908 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 508 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: IslandCoordinator app/src/main/java/com/sameerasw/essentials/island/service/IslandCoordinator.kt:108— ClassTooLong — 835 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 435 over it, 2.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NotificationsPlugin app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:44— ClassTooLong — 806 significant lines (blank, comment-only and punctuation-only lines excluded), 72 methods. The bar is 400 significant lines; this is 406 over it, 2.02× 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: MainActivity app/src/main/java/com/sameerasw/essentials/MainActivity.kt:156— ClassTooLong — 790 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 390 over it, 1.98× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AppFlowHandler app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:49— ClassTooLong — 765 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 365 over it, 1.91× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WatermarkEngine app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:75— ClassTooLong — 758 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 358 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StatusGlanceHandler app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:63— ClassTooLong — 724 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 324 over it, 1.81× 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: FlashlightHandler app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:49— ClassTooLong — 639 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 239 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AppUpdatesViewModel app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:43— ClassTooLong — 531 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 131 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Action app/src/main/java/com/sameerasw/essentials/domain/diy/Action.kt:29— ClassTooLong — 531 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 131 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LocationReachedService app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:41— ClassTooLong — 473 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 73 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: EssentialsInputMethodService app/src/main/java/com/sameerasw/essentials/ime/EssentialsInputMethodService.kt:50— ClassTooLong — 459 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 59 over it, 1.15× 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 (17 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1203— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1203-1219 | app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1223-1239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoTouchHandler.kt:137— app/src/main/java/com/sameerasw/essentials/services/handlers/DuoTouchHandler.kt:137-153 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceTouchHandler.kt:102-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:496— app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:496-512 | app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:36-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) app/src/main/java/com/sameerasw/essentials/translation/TranslatableText.kt:100— app/src/main/java/com/sameerasw/essentials/translation/TranslatableText.kt:100-116 | app/src/main/java/com/sameerasw/essentials/translation/TranslatableText.kt:154-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/translation/TranslatableText.kt:100` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:1175— app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:1175-1191 | app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:1296-1312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:1175` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:1407— app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:1407-1423 | app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:1432-1448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/activities/SettingsActivity.kt:1407` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/components/linkActions/ShareWithFragment.kt:78— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/ShareWithFragment.kt:78-94 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/ShareWithFragment.kt:111-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/ShareWithFragment.kt:78` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/ShareWithFragment.kt:95` calls `repeat`, `Box`, `weight` and `app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/ShareWithFragment.kt:128` 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 × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:218— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:218-234 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:589-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:361— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:361-377 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:682-698 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:361` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt:208— app/src/main/java/com/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt:208-224 | app/src/main/java/com/sameerasw/essentials/ui/features/system/BackGestureSettingsUI.kt:299-315 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/BackGestureSettingsUI.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt:208` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:322— app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:322-338 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:286-302 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:322` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:829— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:829-845 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:131-147 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 259 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:829` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/display/IslandInteractionsSettingsUI.kt:125— app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandInteractionsSettingsUI.kt:125-141 | app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:1026-1042 — 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/sameerasw/essentials/ui/features/display/IslandInteractionsSettingsUI.kt:125` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/features/freeze/components/FreezeTagColorPicker.kt:52— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagColorPicker.kt:52-68 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt:70-86 — 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/sameerasw/essentials/ui/features/freeze/components/FreezeTagColorPicker.kt:52` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:181— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:181-197 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagEditorSheet.kt:208-224 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:181` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/utils/battery/BatteryStatsUtil.kt:89— app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryStatsUtil.kt:89-105 | app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryStatsUtil.kt:129-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4455— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4455-4471 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4492-4508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/viewmodels/MainViewModel.kt:4455` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:381— app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:381-397 | app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:461-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:381` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/data/repository/ContributorsRepository.kt:34— app/src/main/java/com/sameerasw/essentials/data/repository/ContributorsRepository.kt:34-43 | app/src/main/java/com/sameerasw/essentials/data/repository/ContributorsRepository.kt:113-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/data/repository/ContributorsRepository.kt:34` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/data/repository/ContributorsRepository.kt:48— app/src/main/java/com/sameerasw/essentials/data/repository/ContributorsRepository.kt:48-57 | app/src/main/java/com/sameerasw/essentials/data/repository/ProjectDetailsRepository.kt:48-57 — 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/sameerasw/essentials/data/repository/ContributorsRepository.kt:48` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/data/repository/HelpMediaRepository.kt:43— app/src/main/java/com/sameerasw/essentials/data/repository/HelpMediaRepository.kt:43-52 | app/src/main/java/com/sameerasw/essentials/data/repository/HelpMediaRepository.kt:81-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/data/repository/HelpMediaRepository.kt:43` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:282— app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:282-291 | app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:543-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:282` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:555` calls `emptyList` and `app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:293` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:314— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:314-323 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:809-818 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:314` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:961— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:961-970 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:541-550 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/FaceUnlockBrightnessHandler.kt:530— app/src/main/java/com/sameerasw/essentials/services/handlers/FaceUnlockBrightnessHandler.kt:530-539 | app/src/main/java/com/sameerasw/essentials/services/handlers/LockscreenShortcutsHandler.kt:399-408 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandBatteryOptionsBottomSheet.kt:31— app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandBatteryOptionsBottomSheet.kt:31-40 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandTimeOptionsBottomSheet.kt:69-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandBatteryOptionsBottomSheet.kt:31` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/features/watch/ComplicationsSettingsUI.kt:146— app/src/main/java/com/sameerasw/essentials/ui/features/watch/ComplicationsSettingsUI.kt:146-155 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchfaceSettingsUI.kt:283-292 — 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/sameerasw/essentials/ui/features/watch/ComplicationsSettingsUI.kt:146` 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/sameerasw/essentials/utils/ServiceUtils.kt:128— app/src/main/java/com/sameerasw/essentials/utils/ServiceUtils.kt:128-137 | app/src/main/java/com/sameerasw/essentials/utils/ServiceUtils.kt:150-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/utils/ServiceUtils.kt:128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:479— app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:479-488 | app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:550-559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:479` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/data/repository/ProjectDetailsRepository.kt:34— app/src/main/java/com/sameerasw/essentials/data/repository/ProjectDetailsRepository.kt:34-43 | app/src/main/java/com/sameerasw/essentials/data/repository/ProjectDetailsRepository.kt:75-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/data/repository/ProjectDetailsRepository.kt:34` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/services/NotificationListener.kt:430— app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:430-439 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:494-503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/services/NotificationListener.kt:430` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidgetReceiver.kt:25— app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidgetReceiver.kt:25-34 | app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidgetReceiver.kt:25-34 — 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/sameerasw/essentials/services/widgets/FavoritesWidgetReceiver.kt:25` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchfaceSettingsUI.kt:179— app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchfaceSettingsUI.kt:179-188 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchfaceSettingsUI.kt:230-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt:95— app/src/main/java/com/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt:95-104 | app/src/main/java/com/sameerasw/essentials/ui/features/system/BackGestureSettingsUI.kt:176-185 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/BackGestureSettingsUI.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt:95` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:672— app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:672-681 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:688-697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:672` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:859— app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:859-868 | app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:1093-1102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:859` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/MainActivity.kt:736— app/src/main/java/com/sameerasw/essentials/MainActivity.kt:736-744 | app/src/main/java/com/sameerasw/essentials/ui/activities/AppFreezingActivity.kt:202-210 — 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/sameerasw/essentials/MainActivity.kt:736` it begins part-way through the construct above it, so those 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/sameerasw/essentials/MainActivity.kt:735` calls `then` and `app/src/main/java/com/sameerasw/essentials/ui/activities/AppFreezingActivity.kt:201` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/island/ui/LiquidBody.kt:96— app/src/main/java/com/sameerasw/essentials/island/ui/LiquidBody.kt:96-104 | app/src/main/java/com/sameerasw/essentials/island/ui/LiquidField.kt:64-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (9 lines × 2) app/src/main/java/com/sameerasw/essentials/services/CalendarSyncManager.kt:290— app/src/main/java/com/sameerasw/essentials/services/CalendarSyncManager.kt:290-298 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:593-601 — 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/sameerasw/essentials/services/CalendarSyncManager.kt:290` it does not close everything it opens, so those 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/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:603` calls `getInt` and `app/src/main/java/com/sameerasw/essentials/services/CalendarSyncManager.kt:300` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1379— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1379-1387 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1396-1404 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1379` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt:60— app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt:60-68 | app/src/main/java/com/sameerasw/essentials/services/widgets/WidgetScraperService.kt:328-336 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt` and `app/src/main/java/com/sameerasw/essentials/services/widgets/WidgetScraperService.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:574— app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:574-582 | app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:595-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:574` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:464— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:464-472 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:781-789 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt:89— app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt:89-97 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt:124-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/StatusGlanceBatteryOptionsBottomSheet.kt:114— app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/StatusGlanceBatteryOptionsBottomSheet.kt:114-123 | app/src/main/java/com/sameerasw/essentials/ui/features/system/SnippetsSettingsUI.kt:453-461 — 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/sameerasw/essentials/ui/features/display/sheets/StatusGlanceBatteryOptionsBottomSheet.kt:114` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:267— app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:267-275 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:849-857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.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 (9 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchNotificationSettingsUI.kt:96— app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchNotificationSettingsUI.kt:96-104 | app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt:461-469 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:295— app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:295-303 | app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:328-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/sameerasw/essentials/utils/ui/HapticUtil.kt:295` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:443— app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:443-451 | app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:528-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 (9 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1181— app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1181-1189 | app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1768-1776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/data/repository/ContributorsRepository.kt:53— app/src/main/java/com/sameerasw/essentials/data/repository/ContributorsRepository.kt:53-61 | app/src/main/java/com/sameerasw/essentials/data/repository/ContributorsRepository.kt:82-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/data/repository/ContributorsRepository.kt:53` 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/sameerasw/essentials/data/repository/ContributorsRepository.kt:81` calls `setRequestProperty` and `app/src/main/java/com/sameerasw/essentials/data/repository/ContributorsRepository.kt:52` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:989— app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:989-997 | app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:232-240 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) app/src/main/java/com/sameerasw/essentials/services/automation/modules/BluetoothModule.kt:99— app/src/main/java/com/sameerasw/essentials/services/automation/modules/BluetoothModule.kt:99-107 | app/src/main/java/com/sameerasw/essentials/services/automation/modules/NotificationModule.kt:80-88 — 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/sameerasw/essentials/services/automation/modules/BluetoothModule.kt:99` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/viewmodels/WatchViewModel.kt:71— app/src/main/java/com/sameerasw/essentials/viewmodels/WatchViewModel.kt:71-79 | app/src/main/java/com/sameerasw/essentials/viewmodels/WatchViewModel.kt:84-92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:35— app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:35-48 | app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:91-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:35` it begins part-way through the construct above it, so those 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/sameerasw/essentials/services/NotificationListener.kt:1923— app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1923-1936 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:2404-2417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/services/NotificationListener.kt:1923` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/services/widgets/StackHost.kt:486— app/src/main/java/com/sameerasw/essentials/services/widgets/StackHost.kt:486-499 | app/src/main/java/com/sameerasw/essentials/services/widgets/WidgetScraperService.kt:232-245 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt:97— app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt:97-110 | app/src/main/java/com/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt:80-94 — 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/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt:97` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:1444— app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:1444-1457 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchFileActionSheet.kt:213-226 — 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/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:1444` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/components/DeviceHeroCard.kt:363— app/src/main/java/com/sameerasw/essentials/ui/components/DeviceHeroCard.kt:363-376 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/BatteryDetailsBottomSheet.kt:307-320 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/DeviceHeroCard.kt:452— app/src/main/java/com/sameerasw/essentials/ui/components/DeviceHeroCard.kt:452-465 | app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:595-608 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:169— app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:169-182 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:156-169 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:169` 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:183` calls `PaddingValues` and `app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:170` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryAppsTabContent.kt:178— app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryAppsTabContent.kt:178-191 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt:207-220 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryAppsTabContent.kt:178` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:211— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:211-224 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:216-229 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:211` 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:821— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:821-834 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:579-592 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:821` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/display/IslandInteractionsSettingsUI.kt:144— app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandInteractionsSettingsUI.kt:144-157 | app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt:227-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/sameerasw/essentials/ui/features/display/IslandInteractionsSettingsUI.kt:144` 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/sameerasw/essentials/ui/features/system/TextAnimationsSettingsUI.kt:156— app/src/main/java/com/sameerasw/essentials/ui/features/system/TextAnimationsSettingsUI.kt:156-169 | app/src/main/java/com/sameerasw/essentials/ui/features/system/TextAnimationsSettingsUI.kt:319-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/system/TextAnimationsSettingsUI.kt:156` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/utils/DuoOverlayView.kt:845— app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:845-858 | app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:475-488 — 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/sameerasw/essentials/utils/DuoOverlayView.kt:845` 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/sameerasw/essentials/viewmodels/MainViewModel.kt:4284— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4284-4297 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4305-4318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/viewmodels/MainViewModel.kt:4284` 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/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:274— app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:274-287 | app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:309-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:274` 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.
TooManyMethods: SettingsRepository app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:51— TooManyMethods — 924 methods. The bar is 30 methods; this is 894 over it, 30.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MainViewModel app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:119— TooManyMethods — 691 methods. The bar is 30 methods; this is 661 over it, 23.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NotificationsPlugin app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:44— TooManyMethods — 72 methods. The bar is 30 methods; this is 42 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NotificationListener app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:71— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AodWallpaperOverlayHandler app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:69— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DuoOverlayHandler app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:77— TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DuoOverlayView app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:37— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: IslandCoordinator app/src/main/java/com/sameerasw/essentials/island/service/IslandCoordinator.kt:108— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StatusGlanceHandler app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:63— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StatusBarIconViewModel app/src/main/java/com/sameerasw/essentials/viewmodels/StatusBarIconViewModel.kt:34— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PermissionUtils app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt:24— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ScreenOffAccessibilityService app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:77— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StatusGlanceView app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:40— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: HapticUtil app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:42— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WatermarkViewModel app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:49— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Swallowed exception (caught, then discarded) island-sdk/src/main/java/com/sameerasw/island/sdk/IslandCodec.kt:21— `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) island-sdk/src/main/java/com/sameerasw/island/sdk/IslandIdentity.kt:20— `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) island-sdk/src/main/java/com/sameerasw/island/sdk/IslandIdentity.kt:30— `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/sameerasw/essentials/MainActivity.kt:191— `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/sameerasw/essentials/viewmodels/MainViewModel.kt:1895— `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/sameerasw/essentials/viewmodels/MainViewModel.kt:2121— `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/sameerasw/essentials/viewmodels/MainViewModel.kt:2507— `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/sameerasw/essentials/viewmodels/MainViewModel.kt:3753— `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/sameerasw/essentials/viewmodels/MainViewModel.kt:5224— `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/sameerasw/essentials/viewmodels/MainViewModel.kt:9835— `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/sameerasw/essentials/viewmodels/StatusBarIconViewModel.kt:415— `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/sameerasw/essentials/viewmodels/StatusBarIconViewModel.kt:630— `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/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:227— `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/sameerasw/essentials/utils/ActivityLauncherUtil.kt:73— `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/sameerasw/essentials/utils/ActivityLauncherUtil.kt:84— `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 (13 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1511— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1511-1523 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1486-1498 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:819— app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:819-831 | app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:975-987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:819` it begins part-way through the construct above it, so those 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/sameerasw/essentials/services/handlers/AppFlowHandler.kt:833` calls `setProgress` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:988` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:1020— app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:1020-1032 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:1235-1247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:1020` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:279— app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:279-291 | app/src/main/java/com/sameerasw/essentials/ui/features/watermark/WatermarkScreen.kt:175-187 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:279` 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/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:194— app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:194-206 | app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:249-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:194` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:216— app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:216-228 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/InstructionsBottomSheet.kt:114-126 — 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/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:216` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:610— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:610-622 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:820-832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:610` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ColorSwatchPicker.kt:107— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ColorSwatchPicker.kt:107-119 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt:75-87 — 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/sameerasw/essentials/ui/core/pickers/ColorSwatchPicker.kt:107` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:217— app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:217-229 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:304-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:217` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/SendNotificationSettingsSheet.kt:135— app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/SendNotificationSettingsSheet.kt:135-147 | app/src/main/java/com/sameerasw/essentials/ui/features/network/sheets/WifiNetworkSelectionSheet.kt:215-227 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/SendNotificationSettingsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/network/sheets/WifiNetworkSelectionSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/SendNotificationSettingsSheet.kt:135` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:967— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:967-979 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:269-281 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 259 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:967` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:782— app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:782-794 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ButtonRemapSettingsUI.kt:468-480 — 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/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:782` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:190— app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:190-202 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:268-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:190` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1341— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1341-1353 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1367-1379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1341` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:426— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:426-441 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:935-950 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:426` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:780— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:780-795 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:415-430 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:780` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/activities/ShortcutHandlerActivity.kt:54— app/src/main/java/com/sameerasw/essentials/ui/activities/ShortcutHandlerActivity.kt:54-69 | app/src/main/java/com/sameerasw/essentials/ui/activities/ShutUpShortcutActivity.kt:56-71 — 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/sameerasw/essentials/ui/activities/ShortcutHandlerActivity.kt:54` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:239— app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:239-254 | app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:355-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 `app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:239` it does not close everything it opens, so those 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/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:371` calls `Column`, `weight` and `app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:255` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:472— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:472-487 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:561-576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:472` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:823— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:823-838 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:879-894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:823` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ImportConfigConfirmationSheet.kt:41— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ImportConfigConfirmationSheet.kt:41-56 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PreReleaseConfirmationSheet.kt:42-57 — 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/sameerasw/essentials/ui/core/sheets/ImportConfigConfirmationSheet.kt:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt:111— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt:111-126 | app/src/main/java/com/sameerasw/essentials/ui/features/permissions/PermissionsSearchResultCard.kt:92-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt:111` 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/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt:110` calls `onDismissRequest` and `app/src/main/java/com/sameerasw/essentials/ui/features/permissions/PermissionsSearchResultCard.kt:91` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:418— app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:418-433 | app/src/main/java/com/sameerasw/essentials/ui/features/system/ActivityLauncherSettingsUI.kt:176-191 — 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/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:418` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:278— app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:278-293 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:515-530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:278` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt:58— app/src/main/java/com/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt:58-73 | app/src/main/java/com/sameerasw/essentials/ui/features/display/AodWallpaperSettingsUI.kt:71-86 — 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 (16 lines × 2) app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaBubble.kt:89— app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaBubble.kt:89-104 | app/src/main/java/com/sameerasw/essentials/island/plugins/progress/ProgressPlugin.kt:250-265 — 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/sameerasw/essentials/island/plugins/media/MediaBubble.kt:89` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:426— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:426-441 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:495-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:426` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:271— app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:271-285 | app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:299-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot 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/sameerasw/essentials/services/NotificationLightingService.kt:499— app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:499-513 | app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:412-426 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1117— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1117-1131 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:541-555 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:551— app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:551-566 | app/src/main/java/com/sameerasw/essentials/ui/core/media/FeatureHelpMediaViewer.kt:402-416 — 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/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:551` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:243— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:243-257 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:513-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:243` 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/sameerasw/essentials/ui/composables/WelcomeScreen.kt:574— app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:574-588 | app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:1174-1188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/composables/WelcomeScreen.kt:574` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureDropdownRow.kt:136— app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureDropdownRow.kt:136-150 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureToggleRow.kt:83-97 — 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/sameerasw/essentials/ui/core/cards/FeatureDropdownRow.kt:136` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/core/sheets/PixelSearchAppActionSheet.kt:112— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchAppActionSheet.kt:112-126 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchFileActionSheet.kt:128-142 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchAppActionSheet.kt:112` 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/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:61— app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:61-75 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/ChargingModeSettingsSheet.kt:56-70 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/ChargingModeSettingsSheet.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `initialAction` to `Action.SoundMode` in one and `Action.SetChargingMode` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryRingDrawer.kt:62— app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryRingDrawer.kt:62-76 | app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryRingDrawer.kt:123-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt:388— app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt:388-402 | app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt:441-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt:388` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2033— app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2033-2047 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2225-2239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2033` 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/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1112— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1112-1126 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1175-1189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×12
Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:30— app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:30-50 | app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:57-77 | app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:84-104 | app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:111-138 — 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1482— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1482-1496 | app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1566-1580 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1457-1471 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1541-1555 — 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/sameerasw/essentials/ui/activities/BatteryDetailsActivity.kt:25— app/src/main/java/com/sameerasw/essentials/ui/activities/BatteryDetailsActivity.kt:25-45 | app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt:75-115 | app/src/main/java/com/sameerasw/essentials/ui/activities/PrivateDnsSettingsActivity.kt:68-84 | app/src/main/java/com/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt:61-112 — 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/sameerasw/essentials/ui/composables/WelcomeScreen.kt:464— app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:464-588 | app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:594-765 | app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:798-960 | app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:968-1188 — 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/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:66— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:66-240 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:60-186 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt:61-200 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/RestoreModePicker.kt:48-128 — 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/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt:97— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt:97-520 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:60-218 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt:60-324 | app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/DimWallpaperSettingsSheet.kt:57-244 — 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/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt:73— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt:73-203 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FrozenAppsSearchResultCard.kt:65-259 | app/src/main/java/com/sameerasw/essentials/ui/features/permissions/PermissionsSearchResultCard.kt:57-201 | app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:76-381 — 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:67— app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:67-429 | app/src/main/java/com/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt:64-357 | app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:56-383 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:59-299 — 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/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt:49— app/src/main/java/com/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt:49-208 | app/src/main/java/com/sameerasw/essentials/ui/features/display/AodWallpaperSettingsUI.kt:60-441 | app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:88-1260 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:86-968 — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:88— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:88-1260 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:86-968 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:64-515 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:817-882 — 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/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:84— app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:84-132 | app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:182-235 | app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:240-293 | app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:298-351 — 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/sameerasw/essentials/utils/FreezeManager.kt:75— app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:75-109 | app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:209-228 | app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:233-263 | app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:268-287 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (7 lines × 2) app/src/main/java/com/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt:159— app/src/main/java/com/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt:159-165 | app/src/main/java/com/sameerasw/essentials/island/plugins/caffeinate/CaffeinatePlugin.kt:180-186 — 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/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/island/plugins/caffeinate/CaffeinatePlugin.kt:179` calls `islandAccent` and `app/src/main/java/com/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt:158` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaExpanded.kt:285— app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaExpanded.kt:285-293 | app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaExpanded.kt:340-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaExpanded.kt:285` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/utils/DuoOverlayView.kt:1652— app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1652-1658 | app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1723-1729 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/overlay/DashOverlay.kt:220— app/src/main/java/com/sameerasw/essentials/utils/overlay/DashOverlay.kt:220-226 | app/src/main/java/com/sameerasw/essentials/utils/overlay/RippleGlitterView.kt:217-223 — 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/sameerasw/essentials/utils/overlay/DashOverlay.kt:220` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/HilightEffectSheet.kt:126— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/HilightEffectSheet.kt:126-132 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/HilightSettingsUI.kt:338-344 — 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/sameerasw/essentials/ui/core/sheets/HilightEffectSheet.kt:126` 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/sameerasw/essentials/ui/theme/Theme.kt:55— app/src/main/java/com/sameerasw/essentials/ui/theme/Theme.kt:55-61 | app/src/main/java/com/sameerasw/essentials/ui/theme/Theme.kt:69-75 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/theme/Theme.kt:55` 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/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:533— app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:533-539 | app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:77-83 — 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/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:533` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/domain/diy/ActionGsonAdapter.kt:32— app/src/main/java/com/sameerasw/essentials/domain/diy/ActionGsonAdapter.kt:32-38 | app/src/main/java/com/sameerasw/essentials/domain/diy/DIYRepository.kt:47-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/sameerasw/essentials/domain/diy/ActionGsonAdapter.kt:32` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 2) app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:613— app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:613-620 | app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:699-705 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:613` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt:148— app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt:148-154 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt:155-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt:148` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:879— app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:879-885 | app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:494-500 — 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.
Change-coupling hub: NotificationLightingService.kt → NotificationLightingHandler.kt, NotificationLightingSettingsUI.kt, EdgeLightingStylePicker.kt, OverlayHelper.kt app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt— `app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt` changes together with 4 other files — `app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt`, `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt`, `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.kt`, `app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: AutomationEditorActivity.kt → ActionRegistry.kt, AutomationManager.kt, AutomationItem.kt, NewAutomationSheet.kt, DIYViewModel.kt app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt— `app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt` changes together with 5 other files — `app/src/main/java/com/sameerasw/essentials/domain/diy/ActionRegistry.kt`, `app/src/main/java/com/sameerasw/essentials/services/automation/AutomationManager.kt`, `app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt`, `app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/NewAutomationSheet.kt`, `app/src/main/java/com/sameerasw/essentials/viewmodels/DIYViewModel.kt` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: BatteriesWidget.kt → BatteryNotificationService.kt, BatteriesSettingsUI.kt, BatteryRingDrawer.kt app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidget.kt— `app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidget.kt` changes together with 3 other files — `app/src/main/java/com/sameerasw/essentials/services/BatteryNotificationService.kt`, `app/src/main/java/com/sameerasw/essentials/ui/features/battery/BatteriesSettingsUI.kt`, `app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryRingDrawer.kt` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: MainViewModel.kt → ActiveNotificationAlert.kt, AodWallpaperOverlayHandler.kt, DuoOverlayHandler.kt, DuoTouchHandler.kt, StatusGlanceHandler.kt, ConfigSliderItem.kt, DuoOverlayView.kt, FreezeManager.kt, OverlayHelper.kt app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt— `app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt` changes together with 9 other files — `app/src/main/java/com/sameerasw/essentials/domain/model/ActiveNotificationAlert.kt`, `app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt`, `app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt`, `app/src/main/java/com/sameerasw/essentials/services/handlers/DuoTouchHandler.kt`, `app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt`, `app/src/main/java/com/sameerasw/essentials/ui/components/sliders/ConfigSliderItem.kt`, `app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt`, `app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt`, `app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt` — none of which declares a dependency on it: one file is the hub of 9 separate couplings, not 9 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 9.
Change-coupling hub: EdgeLightingStylePicker.kt → NotificationListener.kt, NotificationLightingSettingsUI.kt, OverlayHelper.kt app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.kt— `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.kt` changes together with 3 other files — `app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt`, `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt`, `app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: SettingsRepository.kt → ActiveNotificationAlert.kt, IslandPriorityEntries.kt, ConfigSliderItem.kt, DuoOverlayView.kt app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt— `app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt` changes together with 4 other files — `app/src/main/java/com/sameerasw/essentials/domain/model/ActiveNotificationAlert.kt`, `app/src/main/java/com/sameerasw/essentials/island/model/IslandPriorityEntries.kt`, `app/src/main/java/com/sameerasw/essentials/ui/components/sliders/ConfigSliderItem.kt`, `app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: BatteryCommonComponents.kt → BatteryAppsTabContent.kt, BatteryInfoTabContent.kt, BatteryDetailsBottomSheet.kt app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt— `app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt` changes together with 3 other files — `app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryAppsTabContent.kt`, `app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt`, `app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/BatteryDetailsBottomSheet.kt` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: ScreenOffAccessibilityService.kt → DuoTouchHandler.kt, AlwaysOnDisplaySettingsUI.kt, DuoOverlayView.kt app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt— `app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt` changes together with 3 other files — `app/src/main/java/com/sameerasw/essentials/services/handlers/DuoTouchHandler.kt`, `app/src/main/java/com/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt`, `app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: PermissionRegistry.kt → FeatureRegistry.kt, PermissionUtils.kt, PermissionUIHelper.kt app/src/main/java/com/sameerasw/essentials/domain/registry/PermissionRegistry.kt— `app/src/main/java/com/sameerasw/essentials/domain/registry/PermissionRegistry.kt` changes together with 3 other files — `app/src/main/java/com/sameerasw/essentials/domain/registry/FeatureRegistry.kt`, `app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt`, `app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: CaffeinateSettingsUI.kt → SetupFeatures.kt, StatusBarIconSettingsUI.kt, ScreenOffWidgetSettingsUI.kt app/src/main/java/com/sameerasw/essentials/ui/features/power/CaffeinateSettingsUI.kt— `app/src/main/java/com/sameerasw/essentials/ui/features/power/CaffeinateSettingsUI.kt` changes together with 3 other files — `app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt`, `app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt`, `app/src/main/java/com/sameerasw/essentials/ui/features/tiles/ScreenOffWidgetSettingsUI.kt` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Duplicated block (6 lines × 2) app/src/main/java/com/sameerasw/essentials/island/state/CompactLayoutEngine.kt:204— app/src/main/java/com/sameerasw/essentials/island/state/CompactLayoutEngine.kt:204-209 | app/src/main/java/com/sameerasw/essentials/island/state/CompactLayoutEngine.kt:218-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:192— app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:192-197 | app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:147-152 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:145` calls `getBooleanExtra` and `app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:190` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:674— app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:674-679 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:709-714 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperStagingScreen.kt:136— app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperStagingScreen.kt:136-141 | app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperStagingScreen.kt:168-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperStagingScreen.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperStagingScreen.kt:142` calls `toSet`, `contains` and `app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperStagingScreen.kt:174` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:1223— app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:1223-1228 | app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:1232-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.
Duplicated block (6 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:100— app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:100-105 | app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:249-254 — 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/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:100` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/PocketModeHandler.kt:200— app/src/main/java/com/sameerasw/essentials/services/handlers/PocketModeHandler.kt:200-205 | app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt:468-473 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:128— app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:128-134 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:456-461 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:378— app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:378-383 | app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:840-845 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) scripts/fix_translations.py:122— scripts/fix_translations.py:122-127 | scripts/fix_translations.py:139-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:34— app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:34-53 | app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:63-82 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:34` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:968— app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:968-987 | app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:211-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (20 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1420— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1420-1439 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:601-620 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1420` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/services/handlers/FlashlightHandler.kt:405— app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:405-424 | app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:614-633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:405` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:70— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:70-89 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/NotificationLightingSystemModePicker.kt:71-90 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/NotificationLightingSystemModePicker.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.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 (20 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:354— app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:354-373 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:459-478 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 345 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:354` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/security/AppLockSettingsUI.kt:77— app/src/main/java/com/sameerasw/essentials/ui/features/security/AppLockSettingsUI.kt:77-96 | app/src/main/java/com/sameerasw/essentials/ui/features/security/ScreenLockedSecuritySettingsUI.kt:62-81 — 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/sameerasw/essentials/ui/features/security/AppLockSettingsUI.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.
Duplicated block (20 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1410— app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1410-1429 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1554-1573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1410` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2054— app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2054-2073 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2246-2265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2054` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:233— app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:233-250 | app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:276-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:232` calls `URL` and `app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:273` 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:583— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:583-600 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1107-1124 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:583` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:743— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:743-760 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:384-401 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:743` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/AppPickerAdapter.kt:99— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/AppPickerAdapter.kt:99-116 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/AppPickerAdapter.kt:146-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/AppPickerAdapter.kt:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:77— app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:77-94 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt:82-99 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:77` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/consciousgate/ConsciousGateSettingsUI.kt:204— app/src/main/java/com/sameerasw/essentials/ui/features/consciousgate/ConsciousGateSettingsUI.kt:204-221 | app/src/main/java/com/sameerasw/essentials/ui/features/consciousgate/ConsciousGateSettingsUI.kt:248-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/consciousgate/ConsciousGateSettingsUI.kt:204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:145— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:145-162 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt:161-178 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:145` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:953— app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:953-970 | app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:994-1011 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:953` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:2220— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:2220-2238 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:2241-2258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/viewmodels/MainViewModel.kt:2220` 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/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:424— app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:424-431 | app/src/main/java/com/sameerasw/essentials/island/plugins/calendar/CalendarPlugin.kt:144-151 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:424` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/island/plugins/caffeinate/CaffeinatePlugin.kt:177— app/src/main/java/com/sameerasw/essentials/island/plugins/caffeinate/CaffeinatePlugin.kt:177-184 | app/src/main/java/com/sameerasw/essentials/island/plugins/travel/TravelPlugin.kt:136-143 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/island/plugins/caffeinate/CaffeinatePlugin.kt:177` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1303— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1303-1310 | app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1312-1319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1303` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:1550— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:1550-1557 | app/src/main/java/com/sameerasw/essentials/ui/features/permissions/PermissionsSearchResultCard.kt:186-193 — 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:1550` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/features/power/PowerAndBatterySettingsUI.kt:434— app/src/main/java/com/sameerasw/essentials/ui/features/power/PowerAndBatterySettingsUI.kt:434-441 | app/src/main/java/com/sameerasw/essentials/ui/features/power/PowerAndBatterySettingsUI.kt:451-458 — both copies are in the same file, so extract the 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/sameerasw/essentials/utils/DuoOverlayView.kt:1816— app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1816-1823 | app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1870-1877 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1816` it does not close everything it opens, so those 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/sameerasw/essentials/utils/DuoOverlayView.kt:1812` calls `coerceIn`, `argb`, `toInt` and `app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1868` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:1179— app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:1179-1186 | app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:1218-1225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/utils/StatusGlanceView.kt:1179` 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/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:322— app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:322-329 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:397-404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:322` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/data/repository/WallpaperRepository.kt:44— app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperRepository.kt:44-51 | app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:57-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:538— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:538-542 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1069-1073 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:538` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:555— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:555-559 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:664-668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:555` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:83— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:83-88 | app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:82-86 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (5 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/AodWallpaperSettingsUI.kt:133— app/src/main/java/com/sameerasw/essentials/ui/features/display/AodWallpaperSettingsUI.kt:133-137 | app/src/main/java/com/sameerasw/essentials/ui/features/display/AodWallpaperSettingsUI.kt:150-154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/display/AodWallpaperSettingsUI.kt:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/overlay/DashConfigIo.kt:63— app/src/main/java/com/sameerasw/essentials/utils/overlay/DashConfigIo.kt:63-67 | app/src/main/java/com/sameerasw/essentials/utils/overlay/RippleConfigIo.kt:119-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) app/src/main/java/com/sameerasw/essentials/services/tiles/HeadsUpNotificationsTileService.kt:27— app/src/main/java/com/sameerasw/essentials/services/tiles/HeadsUpNotificationsTileService.kt:27-31 | app/src/main/java/com/sameerasw/essentials/services/tiles/UiBlurTileService.kt:30-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/EssentialsOnDisplaySettingsUI.kt:146— app/src/main/java/com/sameerasw/essentials/ui/features/display/EssentialsOnDisplaySettingsUI.kt:146-150 | app/src/main/java/com/sameerasw/essentials/ui/features/display/EssentialsOnDisplaySettingsUI.kt:171-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/display/EssentialsOnDisplaySettingsUI.kt:146` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) app/src/main/java/com/sameerasw/essentials/island/plugins/call/CallPlugin.kt:316— app/src/main/java/com/sameerasw/essentials/island/plugins/call/CallPlugin.kt:316-320 | app/src/main/java/com/sameerasw/essentials/island/plugins/timer/TimerPlugin.kt:231-235 — 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/sameerasw/essentials/island/plugins/call/CallPlugin.kt:316` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/overlay/DashOverlay.kt:309— app/src/main/java/com/sameerasw/essentials/utils/overlay/DashOverlay.kt:309-313 | app/src/main/java/com/sameerasw/essentials/utils/overlay/RippleGlitterView.kt:317-321 — 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.
Repeated repair: app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:175— app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ShellUtils.newProcess at line 175), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: catch OutOfMemoryError in ShellUtils to prevent crashes during process execution”; “fix: run shell commands off main thread ESSENTIALS-X0”; “fix: add timeout watchdog to shell command execution and optimize bluetooth dumpsys filtering”; “fix: memory crash - ESSENTIALS-WD”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: app/src/main/java/com/sameerasw/essentials/utils/media/AppVolumeController.kt app/src/main/java/com/sameerasw/essentials/utils/media/AppVolumeController.kt:60— app/src/main/java/com/sameerasw/essentials/utils/media/AppVolumeController.kt changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is AppVolumeController.updateState at line 60), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: compute user id from uid directly in AppVolumeController”; “fix: filter audio playback configurations by current user and broaden exception handling in AppVolumeController”; “fix: handle SecurityException when retrieving packages for UID in AppVolumeController ESSENTIALS-WF”; “fix: address review on app volume”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/utils/media/AppVolumeController.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: app/src/main/java/com/sameerasw/essentials/island/plugins/signal/SignalPlugin.kt app/src/main/java/com/sameerasw/essentials/island/plugins/signal/SignalPlugin.kt:245— app/src/main/java/com/sameerasw/essentials/island/plugins/signal/SignalPlugin.kt changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is SignalPlugin.render at line 245), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Fixed 5G cell. connection bug where the cellular icon dissapeared when connected to 5G.”; “fix: more missing dynamic color use in island items”; “fix: WiFi networks strength with VPN”; “fix: update Signal plugin offline icon tint to use primary color”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/island/plugins/signal/SignalPlugin.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: app/src/main/java/com/sameerasw/essentials/utils/StatusBarManager.kt app/src/main/java/com/sameerasw/essentials/utils/StatusBarManager.kt:95— app/src/main/java/com/sameerasw/essentials/utils/StatusBarManager.kt changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is StatusBarManager.applyLocked at line 95), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: guard status bar disable requests with lock ESSENTIALS-Z2”; “fix(shell): add feature name to shizuku error alerts and silence passive background queries”; “fix(statusbar): prevent right-side system icons unhiding on unlock and reboot”; “fix: improve conflicts of statusbar cmd commands”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/utils/StatusBarManager.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidgetReceiver.kt app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidgetReceiver.kt:25— app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidgetReceiver.kt changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is BatteriesWidgetReceiver.onReceive at line 25), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: crash on charger plugged in”; “fix(widget): simplify battery widget charging updates”; “fix(widget): fix battery widget charging status not updating (#1269)”; “fix: memory crash - ESSENTIALS-WD”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidgetReceiver.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: app/src/main/java/com/sameerasw/essentials/island/plugins/network/NetworkPlugin.kt app/src/main/java/com/sameerasw/essentials/island/plugins/network/NetworkPlugin.kt:109— app/src/main/java/com/sameerasw/essentials/island/plugins/network/NetworkPlugin.kt changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is NetworkPlugin.onWifi at line 109), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: more missing dynamic color use in island items”; “fix: add connection settle delays and debouncing to Bluetooth and Network plugins”; “fix: unwanted location use indication caused by network monitor”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/island/plugins/network/NetworkPlugin.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: app/src/main/java/com/sameerasw/essentials/services/handlers/ScreenshotShareCleanupHandler.kt app/src/main/java/com/sameerasw/essentials/services/handlers/ScreenshotShareCleanupHandler.kt:38— app/src/main/java/com/sameerasw/essentials/services/handlers/ScreenshotShareCleanupHandler.kt changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is ScreenshotShareCleanupHandler.onViewClicked at line 38), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: match the Share chip when Pixel appends a role to its label”; “fix: address review on screenshot share cleanup”; “fix: keep screenshots opened in the editor from the share sheet”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/services/handlers/ScreenshotShareCleanupHandler.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: app/src/main/java/com/sameerasw/essentials/services/receivers/StatusBarAutomationReceiver.kt app/src/main/java/com/sameerasw/essentials/services/receivers/StatusBarAutomationReceiver.kt:52— app/src/main/java/com/sameerasw/essentials/services/receivers/StatusBarAutomationReceiver.kt changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is StatusBarAutomationReceiver.updateSystemSetting at line 52), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(widget): simplify battery widget charging updates”; “fix(widget): fix battery widget charging status not updating (#1269)”; “fix: add status bar control guards and fix battery percentage preference reset”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:08:31 +05:30' --until='2026-11-16 19:08:31 +05:30' --full-history --no-merges -- app/src/main/java/com/sameerasw/essentials/services/receivers/StatusBarAutomationReceiver.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.
Duplicated block (21 lines × 2) app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt:325— app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt:325-345 | app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationWarningBottomSheet.kt:238-258 — 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/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt:325` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:378— app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:378-398 | app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:486-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:378` it does not close everything it opens, so those 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/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:507` calls `isNotEmpty` and `app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:399` 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 (21 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:507— app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:507-527 | app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:572-592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:507` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:438— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:438-458 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:513-533 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:438` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1239— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1239-1259 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:537-557 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt:80— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt:80-100 | app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationIconPicker.kt:80-100 — 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/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt:80` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (21 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:351— app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:351-371 | app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt:1180-1200 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchfaceSettingsUI.kt:327— app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchfaceSettingsUI.kt:327-347 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchfaceSettingsUI.kt:356-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchfaceSettingsUI.kt:327` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) app/src/main/java/com/sameerasw/essentials/input/PowerPressDetector.kt:71— app/src/main/java/com/sameerasw/essentials/input/PowerPressDetector.kt:71-89 | app/src/main/java/com/sameerasw/essentials/input/VolumeLongPressDetector.kt:42-60 — 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/sameerasw/essentials/input/PowerPressDetector.kt:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot 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/sameerasw/essentials/ui/activities/PrivateDnsSettingsActivity.kt:426— app/src/main/java/com/sameerasw/essentials/ui/activities/PrivateDnsSettingsActivity.kt:426-444 | app/src/main/java/com/sameerasw/essentials/ui/activities/PrivateDnsSettingsActivity.kt:471-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/activities/PrivateDnsSettingsActivity.kt:426` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:259— app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:259-277 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/GenAIAutomationPreviewSheet.kt:141-159 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:259` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (19 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt:69— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt:69-87 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt:71-89 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt:69` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AddRepoBottomSheet.kt:218— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AddRepoBottomSheet.kt:218-236 | app/src/main/java/com/sameerasw/essentials/ui/features/system/SnippetsSettingsUI.kt:374-392 — 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/sameerasw/essentials/ui/core/sheets/AddRepoBottomSheet.kt:218` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:239— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:239-257 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:270-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryAppsTabContent.kt:158— app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryAppsTabContent.kt:158-176 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt:187-205 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:114— app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:114-132 | app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:217-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:114` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:279— app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:279-290 | app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:342-353 | app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:485-496 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) app/src/main/java/com/sameerasw/essentials/translation/ui/TranslatableCardContainer.kt:95— app/src/main/java/com/sameerasw/essentials/translation/ui/TranslatableCardContainer.kt:95-108 | app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationMenuItems.kt:38-49 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/PermissionCard.kt:229-242 — 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/sameerasw/essentials/translation/ui/TranslatableCardContainer.kt:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:830— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:830-841 | app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:910-921 | app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:1264-1275 — 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/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:830` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/activities/DebuggingSettingsActivity.kt:165— app/src/main/java/com/sameerasw/essentials/ui/activities/DebuggingSettingsActivity.kt:165-176 | app/src/main/java/com/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt:155-167 | app/src/main/java/com/sameerasw/essentials/ui/activities/WidgetStackConfigureActivity.kt:291-302 — 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/sameerasw/essentials/ui/activities/DebuggingSettingsActivity.kt:165` it begins part-way through the construct above it, so those 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/sameerasw/essentials/ui/activities/DebuggingSettingsActivity.kt:162` calls `padding`, `navigationBarsPadding` and `app/src/main/java/com/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt:153` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:216— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:216-227 | app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:151-162 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:221-232 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:216` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:146— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:146-157 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:541-552 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:725-736 — 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/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:146` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandInteractionsSettingsUI.kt:149— app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandInteractionsSettingsUI.kt:149-160 | app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt:232-243 | app/src/main/java/com/sameerasw/essentials/ui/features/system/FaceUnlockBrightnessSettingsUI.kt:159-171 — 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/sameerasw/essentials/ui/features/display/IslandInteractionsSettingsUI.kt:149` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1277— app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1277-1288 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1405-1416 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1792-1803 — 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/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1277` 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.
X2 · Cancellation propagation· Suspend function with a blocking request · ×8
Suspend function with a blocking request: requestDeviceCode app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:26— `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: requestDeviceCodeWithWorkflow app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:55— `requestDeviceCodeWithWorkflow` 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: pollForToken app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:84— `pollForToken` 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: fetchStagedWallpaper app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:29— `fetchStagedWallpaper` 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: fetchMobileHistory app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:84— `fetchMobileHistory` 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: fetchCollectionTotalPages app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:119— `fetchCollectionTotalPages` 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: fetchCollectionPhotos app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:144— `fetchCollectionPhotos` 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: stageTomorrowWallpaper app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:202— `stageTomorrowWallpaper` 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`.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×7
Edited copy of a member (12 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:876— app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:876-887 | app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:491-502 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:1107— app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:1107-1118 | app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:735-746 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt:493— app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt:493-504 | app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt:511-522 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/tiles/BaseTileService.kt:146— app/src/main/java/com/sameerasw/essentials/services/tiles/BaseTileService.kt:146-158 | app/src/main/java/com/sameerasw/essentials/services/tiles/DefaultLauncherTileService.kt:50-61 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) app/src/main/java/com/sameerasw/essentials/viewmodels/WatchViewModel.kt:70— app/src/main/java/com/sameerasw/essentials/viewmodels/WatchViewModel.kt:70-81 | app/src/main/java/com/sameerasw/essentials/viewmodels/WatchViewModel.kt:83-94 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:359— app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:359-373 | app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:383-394 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/tiles/DeveloperOptionsTileService.kt:26— app/src/main/java/com/sameerasw/essentials/services/tiles/DeveloperOptionsTileService.kt:26-37 | app/src/main/java/com/sameerasw/essentials/services/tiles/MapsPowerSavingTileService.kt:27-38 — 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 (20 corresponding lines) · ×6
Edited copy of a member (20 corresponding lines) app/src/main/java/com/sameerasw/essentials/island/plugins/signal/SignalPlugin.kt:300— app/src/main/java/com/sameerasw/essentials/island/plugins/signal/SignalPlugin.kt:300-319 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:517-537 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/UrlShortener.kt:451— app/src/main/java/com/sameerasw/essentials/utils/UrlShortener.kt:451-475 | app/src/main/java/com/sameerasw/essentials/utils/UrlShortener.kt:477-496 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaExpanded.kt:464— app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaExpanded.kt:464-483 | app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaExpanded.kt:526-551 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:495— app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:495-514 | app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:34-54 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/activities/AppLockActivity.kt:184— app/src/main/java/com/sameerasw/essentials/ui/activities/AppLockActivity.kt:184-206 | app/src/main/java/com/sameerasw/essentials/ui/activities/AppLockActivity.kt:208-227 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/activities/ConsciousGateActivity.kt:118— app/src/main/java/com/sameerasw/essentials/ui/activities/ConsciousGateActivity.kt:118-137 | app/src/main/java/com/sameerasw/essentials/ui/activities/ConsciousGateActivity.kt:139-158 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (31 lines × 2) app/src/main/java/com/sameerasw/essentials/translation/ui/TranslatableCardContainer.kt:89— app/src/main/java/com/sameerasw/essentials/translation/ui/TranslatableCardContainer.kt:89-119 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/PermissionCard.kt:223-253 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (31 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:390— app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:390-420 | app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:497-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:390` 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/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:743— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:743-773 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:1014-1044 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:743` 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/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:115— app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:115-145 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt:109-139 — 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/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:115` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:309— app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:309-339 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:402-432 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 345 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:309` 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 (31 lines × 2) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:6765— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:6765-6795 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:7678-7708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/viewmodels/MainViewModel.kt:6765` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1363— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1363-1377 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1381-1394 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1363` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14–15 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1005— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1005-1018 | app/src/main/java/com/sameerasw/essentials/services/handlers/SmartPixelsHandler.kt:135-149 — 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/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1005` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidgetReceiver.kt:40— app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidgetReceiver.kt:40-53 | app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidgetReceiver.kt:56-70 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:551— app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:551-565 | app/src/main/java/com/sameerasw/essentials/ui/core/media/FeatureHelpMediaViewer.kt:381-394 — 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/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:551` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/hardware/PocketModeSettingsUI.kt:120— app/src/main/java/com/sameerasw/essentials/ui/features/hardware/PocketModeSettingsUI.kt:120-133 | app/src/main/java/com/sameerasw/essentials/ui/features/network/DynamicNightLightSettingsUI.kt:70-84 — 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/sameerasw/essentials/ui/features/hardware/PocketModeSettingsUI.kt:120` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/features/hardware/PocketModeSettingsUI.kt:116` calls `Spacer`, `size` and `app/src/main/java/com/sameerasw/essentials/ui/features/network/DynamicNightLightSettingsUI.kt:66` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–15 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:98— app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:98-112 | app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:183-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt:156— app/src/main/java/com/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt:156-190 | app/src/main/java/com/sameerasw/essentials/island/plugins/caffeinate/CaffeinatePlugin.kt:176-232 | app/src/main/java/com/sameerasw/essentials/island/plugins/navigation/NavigationExpanded.kt:38-93 | app/src/main/java/com/sameerasw/essentials/island/plugins/progress/ProgressExpanded.kt:47-102 | app/src/main/java/com/sameerasw/essentials/island/plugins/travel/TravelPlugin.kt:135-187 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/sameerasw/essentials/services/receivers/QsTileActionRouter.kt:37— app/src/main/java/com/sameerasw/essentials/services/receivers/QsTileActionRouter.kt:37-118 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:179-238 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:244-266 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:272-325 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:332-376 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:130— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:130-1518 | app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:88-1260 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:86-968 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:64-515 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:90-673 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:130— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:130-1518 | app/src/main/java/com/sameerasw/essentials/ui/activities/LinkPickerActivity.kt:26-83 | app/src/main/java/com/sameerasw/essentials/ui/activities/LocationAlarmActivity.kt:67-91 | app/src/main/java/com/sameerasw/essentials/ui/activities/ShortcutHandlerActivity.kt:37-98 | app/src/main/java/com/sameerasw/essentials/ui/activities/ShutUpShortcutActivity.kt:44-110 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:130— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:130-1518 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:82-293 | app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:81-319 | app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:329-458 | app/src/main/java/com/sameerasw/essentials/ui/features/system/ActivityLauncherSettingsUI.kt:65-85 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×5
Edited copy of a member (14 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/call/CallerLookup.kt:21— app/src/main/java/com/sameerasw/essentials/utils/call/CallerLookup.kt:21-34 | app/src/main/java/com/sameerasw/essentials/utils/call/CallerLookup.kt:36-51 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/overlay/DashOverlay.kt:216— app/src/main/java/com/sameerasw/essentials/utils/overlay/DashOverlay.kt:216-229 | app/src/main/java/com/sameerasw/essentials/utils/overlay/RippleGlitterView.kt:213-226 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt:30— app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt:30-43 | app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt:49-63 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:383— app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:383-396 | app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:420-433 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/AppDetectionService.kt:193— app/src/main/java/com/sameerasw/essentials/services/AppDetectionService.kt:193-206 | app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:614-630 — 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) · ×5
Edited copy of a member (19 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:1443— app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:1443-1461 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchFileActionSheet.kt:212-230 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) app/src/main/java/com/sameerasw/essentials/ime/UndoRedoManager.kt:34— app/src/main/java/com/sameerasw/essentials/ime/UndoRedoManager.kt:34-52 | app/src/main/java/com/sameerasw/essentials/ime/UndoRedoManager.kt:54-73 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:271— app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:271-289 | app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:299-317 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:802— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:802-820 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:627-645 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/activities/ActionShortcutActivity.kt:23— app/src/main/java/com/sameerasw/essentials/ui/activities/ActionShortcutActivity.kt:23-41 | app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarTapActivity.kt:22-42 — 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 (11 corresponding lines) · ×5
Edited copy of a member (11 corresponding lines) app/src/main/java/com/sameerasw/essentials/island/gestures/HiddenGestureDetector.kt:39— app/src/main/java/com/sameerasw/essentials/island/gestures/HiddenGestureDetector.kt:39-49 | app/src/main/java/com/sameerasw/essentials/island/ui/CompactInteraction.kt:172-182 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) app/src/main/java/com/sameerasw/essentials/viewmodels/LocationReachedViewModel.kt:135— app/src/main/java/com/sameerasw/essentials/viewmodels/LocationReachedViewModel.kt:135-146 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:10914-10924 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:214— app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:214-224 | app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:226-238 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1389— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1389-1399 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1406-1416 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:449— app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:449-459 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1681-1692 — 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 (8 corresponding lines) · ×5
Edited copy of a member (8 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryInfoUtil.kt:440— app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryInfoUtil.kt:440-447 | app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryInfoUtil.kt:496-505 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) app/src/main/java/com/sameerasw/essentials/data/repository/LocationReachedRepository.kt:121— app/src/main/java/com/sameerasw/essentials/data/repository/LocationReachedRepository.kt:121-128 | app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:2712-2719 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) app/src/main/java/com/sameerasw/essentials/domain/controller/HotspotController.kt:74— app/src/main/java/com/sameerasw/essentials/domain/controller/HotspotController.kt:74-81 | app/src/main/java/com/sameerasw/essentials/services/tiles/DataSimController.kt:130-137 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/activities/WidgetStackConfigureActivity.kt:512— app/src/main/java/com/sameerasw/essentials/ui/activities/WidgetStackConfigureActivity.kt:512-519 | app/src/main/java/com/sameerasw/essentials/ui/features/security/ScreenshotsSettingsUI.kt:205-212 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/FaceUnlockBrightnessHandler.kt:403— app/src/main/java/com/sameerasw/essentials/services/handlers/FaceUnlockBrightnessHandler.kt:403-410 | app/src/main/java/com/sameerasw/essentials/services/handlers/LockscreenShortcutsHandler.kt:290-297 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (25 lines × 2) app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:166— app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:166-190 | app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:120-144 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:146` calls `getBooleanExtra` and `app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:192` 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 (25 lines × 2) app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt:267— app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt:267-291 | app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidget.kt:250-274 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt` and `app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidget.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/services/widgets/FavoritesWidget.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 (25 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:1083— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:1083-1107 | app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:1198-1222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:1083` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:386— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:386-410 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:708-732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:386` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (25 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/cards/PermissionCard.kt:276— app/src/main/java/com/sameerasw/essentials/ui/core/cards/PermissionCard.kt:276-300 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/PermissionCard.kt:326-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/core/cards/PermissionCard.kt:276` it does not close everything it opens, so those exact lines 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 × 3) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:729— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:729-742 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:174-187 | app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:376-389 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (14 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/core/cards/ConfigPickerItem.kt:59— app/src/main/java/com/sameerasw/essentials/ui/core/cards/ConfigPickerItem.kt:59-72 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:68-81 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt:63-76 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:85— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:85-98 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:84-97 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt:81-94 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:85` it does not close everything it opens, so those exact lines 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 × 3) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/HilightEffectSheet.kt:255— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/HilightEffectSheet.kt:255-268 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetModeSettingsSheet.kt:209-222 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt:176-189 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetModeSettingsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/core/sheets/HilightEffectSheet.kt:255` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:989— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:989-1002 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:291-304 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:382-395 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 259 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:989` 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 × 4) app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:214— app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:214-224 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:245-255 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:302-312 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:346-356 — 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/sameerasw/essentials/services/tiles/QsTileRegistry.kt:214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:830— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:830-840 | app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:910-920 | app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:962-972 | app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:1264-1274 — 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/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:830` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/activities/BatteryDetailsActivity.kt:27— app/src/main/java/com/sameerasw/essentials/ui/activities/BatteryDetailsActivity.kt:27-37 | app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt:101-111 | app/src/main/java/com/sameerasw/essentials/ui/activities/PrivateDnsSettingsActivity.kt:70-80 | app/src/main/java/com/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt:84-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/activities/BatteryDetailsActivity.kt:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:865— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:865-875 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:623-633 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:167-177 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:840-850 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:865` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1056— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1056-1066 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:812-822 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:358-368 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:463-473 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1056` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:241— app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:241-251 | app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:357-367 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/GenAIAutomationPreviewSheet.kt:123-133 — 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/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:241` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:726— app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:726-736 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:362-372 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/FlashlightSettingsUI.kt:42-52 — 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/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:726` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:786— app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:786-796 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ButtonRemapSettingsUI.kt:472-482 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/HilightSettingsUI.kt:528-538 — 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/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:786` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/hardware/PocketModeSettingsUI.kt:60— app/src/main/java/com/sameerasw/essentials/ui/features/hardware/PocketModeSettingsUI.kt:60-70 | app/src/main/java/com/sameerasw/essentials/ui/features/security/ScreenLockedSecuritySettingsUI.kt:71-81 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:267-277 — 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/sameerasw/essentials/ui/features/hardware/PocketModeSettingsUI.kt:60` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2048— app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2048-2058 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2240-2250 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2274-2284 — 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/sameerasw/essentials/ui/ime/KeyboardInputView.kt:2048` 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.
ScrollMotionBlurModifierKt.scrollMotionBlur (cognitive 22) app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:80— ScrollMotionBlurModifierKt.scrollMotionBlur has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 3 other methods here (ScrollMotionBlurModifierKt.scrollMotionBlur, ScrollMotionBlurModifierKt.scrollMotionBlur, ScrollMotionBlurModifierKt.scrollMotionBlur) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
ScrollMotionBlurModifierKt.scrollMotionBlur (cognitive 22) app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:178— ScrollMotionBlurModifierKt.scrollMotionBlur has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 3 other methods here (ScrollMotionBlurModifierKt.scrollMotionBlur, ScrollMotionBlurModifierKt.scrollMotionBlur, ScrollMotionBlurModifierKt.scrollMotionBlur) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
ScrollMotionBlurModifierKt.scrollMotionBlur (cognitive 22) app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:237— ScrollMotionBlurModifierKt.scrollMotionBlur has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 3 other methods here (ScrollMotionBlurModifierKt.scrollMotionBlur, ScrollMotionBlurModifierKt.scrollMotionBlur, ScrollMotionBlurModifierKt.scrollMotionBlur) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
ScrollMotionBlurModifierKt.scrollMotionBlur (cognitive 22) app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:295— ScrollMotionBlurModifierKt.scrollMotionBlur has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 3 other methods here (ScrollMotionBlurModifierKt.scrollMotionBlur, ScrollMotionBlurModifierKt.scrollMotionBlur, ScrollMotionBlurModifierKt.scrollMotionBlur) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×4
Edited copy of a member (6 corresponding lines) app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:784— app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:784-789 | app/src/main/java/com/sameerasw/essentials/utils/TimeUtil.kt:71-82 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryInfoUtil.kt:429— app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryInfoUtil.kt:429-434 | app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryInfoUtil.kt:485-490 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:750— app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:750-755 | app/src/main/java/com/sameerasw/essentials/utils/PriorityModeUtil.kt:19-25 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidget.kt:155— app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidget.kt:155-160 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/BatteriesPreviewCard.kt:63-68 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×4
Edited copy of a member (7 corresponding lines) app/src/main/java/com/sameerasw/essentials/island/plugins/PluginUtils.kt:12— app/src/main/java/com/sameerasw/essentials/island/plugins/PluginUtils.kt:12-18 | app/src/main/java/com/sameerasw/essentials/utils/ui/ColorUtil.kt:48-59 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:71— app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:71-81 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:302-308 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt:522— app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt:522-528 | app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt:354-360 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:7244— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:7244-7254 | app/src/main/java/com/sameerasw/essentials/services/tiles/RestartSystemUiTileService.kt:73-79 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (28 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:1283— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:1283-1310 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:1431-1458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:1283` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:159— app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:159-186 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:239-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt:81— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt:81-108 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/SegmentedPicker.kt:88-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt:80` calls `contains` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/SegmentedPicker.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 (28 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:182— app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:182-209 | app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:240-267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:182` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:386— app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:386-407 | app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:848-869 — both copies are in the same file, so extract the 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:190— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:190-211 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:564-585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:190` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:239— app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:239-260 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:327-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:239` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt:100— app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt:100-121 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt:217-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt:100` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20–21 lines × 2) app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt:272— app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt:272-292 | app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationSessionSheet.kt:304-323 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt:272` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt:147— app/src/main/java/com/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt:147-167 | app/src/main/java/com/sameerasw/essentials/ui/activities/WidgetStackConfigureActivity.kt:283-302 — 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/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt:147` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20–21 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:721— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:721-741 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:993-1012 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:721` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20–21 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt:141— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt:141-160 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt:179-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:399— app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:399-414 | app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:455-470 | app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:516-531 | app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:581-596 — 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/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:399` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:100— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:100-115 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:99-114 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt:96-111 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/RestoreModePicker.kt:62-77 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:100` 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:236— app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:236-251 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:324-339 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:209-224 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:288-303 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:236` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:924— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:924-939 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:682-697 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:226-241 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:214-229 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:79— app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:79-94 | app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:159-173 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15–16 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:556— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:556-571 | app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:575-589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:556` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–16 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/HelpAndGuides.kt:240— app/src/main/java/com/sameerasw/essentials/ui/components/HelpAndGuides.kt:240-255 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/LicensesBottomSheet.kt:269-283 — 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/sameerasw/essentials/ui/components/HelpAndGuides.kt:240` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt:766— app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt:766-781 | app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt:830-844 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/utils/OverlayHelper.kt:766` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt:324— app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt:324-336 | app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:718-731 — 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/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt:324` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:655— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:655-668 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:747-759 — 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/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:655` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt:185— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt:185-198 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FrozenAppsSearchResultCard.kt:79-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13–14 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:114— app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:114-127 | app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:199-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:156— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:156-168 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt:153-165 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/RestoreModePicker.kt:100-112 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:156` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:155` calls `performUIHaptic` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/RestoreModePicker.kt:99` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandCallOptionsBottomSheet.kt:53— app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandCallOptionsBottomSheet.kt:53-65 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandLiveUpdatesOptionsBottomSheet.kt:49-61 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandNavigationOptionsBottomSheet.kt:57-69 — 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/sameerasw/essentials/ui/features/display/sheets/IslandCallOptionsBottomSheet.kt:53` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt:532— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt:532-544 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:123-135 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt:139-151 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt:532` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FrozenAppsSearchResultCard.kt:106— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FrozenAppsSearchResultCard.kt:106-118 | app/src/main/java/com/sameerasw/essentials/ui/features/permissions/PermissionsSearchResultCard.kt:71-83 | app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:141-153 — 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/sameerasw/essentials/ui/features/freeze/FrozenAppsSearchResultCard.kt:106` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:607— app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:607-616 | app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:1039-1049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:1051` calls `recycle` and `app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:617` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 2) app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:199— app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:199-208 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:218-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:667— app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:667-677 | app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:1075-1084 — 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/sameerasw/essentials/ui/activities/SettingsActivity.kt:667` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–11 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:95— app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:95-105 | app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:176-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:93` calls `buildUpon`, `appendId` and `app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:175` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 2) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:917— app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:917-924 | app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:194-202 — 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/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:917` 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–9 lines × 2) app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:365— app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:365-373 | app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:256-263 — 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/sameerasw/essentials/services/LocationReachedService.kt:365` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) app/src/main/java/com/sameerasw/essentials/services/ScreenOffWidgetProvider.kt:124— app/src/main/java/com/sameerasw/essentials/services/ScreenOffWidgetProvider.kt:124-131 | app/src/main/java/com/sameerasw/essentials/services/ScreenOffWidgetProvider.kt:168-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/services/ScreenOffWidgetProvider.kt:124` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:1012— app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:1012-1020 | app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:1031-1038 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:1012` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt:157— app/src/main/java/com/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt:157-163 | app/src/main/java/com/sameerasw/essentials/island/plugins/navigation/NavigationExpanded.kt:39-45 | app/src/main/java/com/sameerasw/essentials/island/plugins/progress/ProgressExpanded.kt:49-55 — 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/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt:157` it does not close everything it opens, so those 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/sameerasw/essentials/island/plugins/progress/ProgressExpanded.kt:48` calls `IslandSurfaceAccent` and `app/src/main/java/com/sameerasw/essentials/island/plugins/navigation/NavigationExpanded.kt:38` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) app/src/main/java/com/sameerasw/essentials/MainActivity.kt:1175— app/src/main/java/com/sameerasw/essentials/MainActivity.kt:1175-1181 | app/src/main/java/com/sameerasw/essentials/MainActivity.kt:1190-1196 | app/src/main/java/com/sameerasw/essentials/MainActivity.kt:1204-1211 — 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/sameerasw/essentials/MainActivity.kt:1175` it does not close everything it opens, so those 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/sameerasw/essentials/MainActivity.kt:1175` calls `UnderlayBlur` and `app/src/main/java/com/sameerasw/essentials/MainActivity.kt:1204` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) app/src/main/java/com/sameerasw/essentials/island/gestures/CompactGestureController.kt:124— app/src/main/java/com/sameerasw/essentials/island/gestures/CompactGestureController.kt:124-130 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoTouchHandler.kt:366-372 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceTouchHandler.kt:261-267 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1346— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1346-1352 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1354-1360 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1372-1378 — 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/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1346` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×3
Edited copy of a member (29 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1359— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1359-1387 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1376-1404 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt:323— app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt:323-351 | app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:717-748 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:781— app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:781-809 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/HilightSettingsUI.kt:523-551 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 27+ corresponding lines) · ×3
Edited copies of one member (3 members, 27+ corresponding lines) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1634— app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1634-1660 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1746-1785 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1787-1820 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 27+ corresponding lines) app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:27— app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:27-53 | app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:56-82 | app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt:88-115 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 27+ corresponding lines) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4614— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4614-4640 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:5006-5043 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:5045-5072 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×3
Edited copy of a member (13 corresponding lines) app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:423— app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:423-435 | app/src/main/java/com/sameerasw/essentials/island/plugins/calendar/CalendarPlugin.kt:143-155 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) app/src/main/java/com/sameerasw/essentials/domain/diy/ActionGsonAdapter.kt:44— app/src/main/java/com/sameerasw/essentials/domain/diy/ActionGsonAdapter.kt:44-56 | app/src/main/java/com/sameerasw/essentials/domain/diy/DIYRepository.kt:59-73 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:132— app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:132-144 | app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:146-158 — 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 (9 corresponding lines) · ×3
Edited copy of a member (9 corresponding lines) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:914— app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:914-925 | app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:194-202 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) app/src/main/java/com/sameerasw/essentials/data/repository/LocationReachedRepository.kt:104— app/src/main/java/com/sameerasw/essentials/data/repository/LocationReachedRepository.kt:104-112 | app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1306-1314 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/activities/ConsciousGateActivity.kt:177— app/src/main/java/com/sameerasw/essentials/ui/activities/ConsciousGateActivity.kt:177-185 | app/src/main/java/com/sameerasw/essentials/ui/activities/LinkPickerActivity.kt:85-93 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×3
Edited copy of a member (10 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/features/system/ActivityLauncherSettingsUI.kt:221— app/src/main/java/com/sameerasw/essentials/ui/features/system/ActivityLauncherSettingsUI.kt:221-230 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchEsimInstallSheet.kt:272-281 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/hardware/RefreshRateUtils.kt:80— app/src/main/java/com/sameerasw/essentials/utils/hardware/RefreshRateUtils.kt:80-89 | app/src/main/java/com/sameerasw/essentials/utils/hardware/RefreshRateUtils.kt:95-112 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:1149— app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:1149-1160 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:702-711 — 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.
Duplicated block (32 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1588— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1588-1619 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1563-1594 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (32 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:605— app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:605-636 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:806-837 — 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/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:605` 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/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:155— app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:155-186 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:164-195 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:155` 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: `LocalLifecycleOwner` names `androidx.compose.ui.platform.LocalLifecycleOwner` in one and `androidx.lifecycle.compose.LocalLifecycleOwner` 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 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:737— app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:737-765 | app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:932-960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/composables/WelcomeScreen.kt:737` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt:49— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt:49-77 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingColorModePicker.kt:46-74 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingColorModePicker.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/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:92— app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:92-120 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:93-121 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1135— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1135-1161 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:554-580 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/services/dreams/AmbientDreamService.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 (27 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt:142— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt:142-168 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/SegmentedPicker.kt:158-184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt:142` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:237— app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:237-263 | app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt:1063-1089 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:237` it does not close everything it opens, so those 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/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt:1090` calls `withContext`, `invoke` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:264` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (24 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:169— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:169-192 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:163-186 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:169` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:278— app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:278-301 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:369-392 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 345 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:278` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1334— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1334-1357 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1211-1234 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 3) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1096— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1096-1115 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:556-575 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:841-860 — 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.
Duplicated block (20 lines × 3) app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt:207— app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt:207-227 | app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt:272-291 | app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidget.kt:255-274 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt` and `app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidget.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/services/widgets/FavoritesWidget.kt:207` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:378— app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:378-397 | app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:427-446 | app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:485-504 — 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/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:378` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16–17 lines × 2) app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt:1065— app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt:1065-1080 | app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt:1231-1247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/island/ui/IslandRoot.kt:1231` 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/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:96— app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:96-112 | app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:140-155 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:83— app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:83-99 | app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:240-255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:83` it does not close everything it opens, so those 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/sameerasw/essentials/utils/FreezeManager.kt:79` calls `getBoolean` and `app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:236` 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 × 4) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1483— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1483-1496 | app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1567-1580 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1458-1471 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:1542-1555 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:252— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:252-265 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:475-488 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:491-504 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:522-535 — 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:252` 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 × 4) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:141— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:141-154 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:136-149 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:106-119 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:140-153 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:733— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:733-741 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:178-186 | app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:380-388 | app/src/main/java/com/sameerasw/essentials/ui/features/system/ActivityLauncherSettingsUI.kt:70-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (9 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:701— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:701-709 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:722-730 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:974-982 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:994-1002 — 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/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:701` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:81— app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:81-89 | app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:212-220 | app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:238-246 | app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:271-279 — 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/sameerasw/essentials/utils/FreezeManager.kt:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:78` calls `getString`, `getBoolean` and `app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:211` 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.
Near-duplicate member pair (97 shared lines) app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:67— app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:67-429 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:57-314 — These two members are variants of one another: 97 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 (97 shared lines) app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:76— app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:76-381 | app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:109-499 — These two members are variants of one another: 97 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AodCompatibilityInfoBottomSheet.kt:31— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AodCompatibilityInfoBottomSheet.kt:31-69 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CameraFlipInfoBottomSheet.kt:25-64 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/HideStatusBarInfoBottomSheet.kt:31-69 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PreferStillIslandInfoBottomSheet.kt:22-55 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/StatusBarAwareWidthInfoBottomSheet.kt:22-60 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandDevicesBatteryBottomSheet.kt:45-108 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/src/main/java/com/sameerasw/essentials/ui/features/consciousgate/ConsciousGateSettingsUI.kt:64— app/src/main/java/com/sameerasw/essentials/ui/features/consciousgate/ConsciousGateSettingsUI.kt:64-381 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/PocketModeSettingsUI.kt:46-189 | app/src/main/java/com/sameerasw/essentials/ui/features/security/AppLockSettingsUI.kt:54-231 | app/src/main/java/com/sameerasw/essentials/ui/features/security/ScreenLockedSecuritySettingsUI.kt:43-155 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:59-299 | app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:71-697 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×2
Edited copy of a member (26 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:223— app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:223-254 | app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:327-352 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:491— app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:491-521 | app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:408-433 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:403— app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:403-431 | app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt:198-225 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/tiles/AppLockTileService.kt:22— app/src/main/java/com/sameerasw/essentials/services/tiles/AppLockTileService.kt:22-49 | app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenLockedSecurityTileService.kt:21-48 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×2
Edited copy of a member (24 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/AppUtil.kt:277— app/src/main/java/com/sameerasw/essentials/utils/AppUtil.kt:277-300 | app/src/main/java/com/sameerasw/essentials/utils/AppUtil.kt:310-337 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1196— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1196-1219 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:790-814 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×2
Edited copy of a member (22 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt:414— app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt:414-441 | app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt:642-663 — 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/sameerasw/essentials/services/tiles/BaseTileService.kt:189— app/src/main/java/com/sameerasw/essentials/services/tiles/BaseTileService.kt:189-210 | app/src/main/java/com/sameerasw/essentials/services/tiles/BaseTileService.kt:228-249 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×2
Edited copies of one member (3 members, 14+ corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:144— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:144-157 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:539-552 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:723-736 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchAppActionSheet.kt:219— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchAppActionSheet.kt:219-235 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchFileActionSheet.kt:232-245 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchFileActionSheet.kt:247-261 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1178— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1178-1194 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:772-788 — 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/sameerasw/essentials/services/handlers/StatusBarIconHandler.kt:175— app/src/main/java/com/sameerasw/essentials/services/handlers/StatusBarIconHandler.kt:175-191 | app/src/main/java/com/sameerasw/essentials/viewmodels/StatusBarIconViewModel.kt:582-607 — 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 (18 corresponding lines) · ×2
Edited copy of a member (18 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:307— app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:307-324 | app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt:329-346 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:3215— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:3215-3234 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:3256-3273 — 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 (15 corresponding lines) · ×2
Edited copy of a member (15 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/activities/DebuggingSettingsActivity.kt:64— app/src/main/java/com/sameerasw/essentials/ui/activities/DebuggingSettingsActivity.kt:64-78 | app/src/main/java/com/sameerasw/essentials/ui/activities/SmartPixelsIntensityActivity.kt:57-74 — 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/sameerasw/essentials/viewmodels/MainViewModel.kt:3574— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:3574-3588 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:3595-3609 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×2
Edited copies of one member (3 members, 10+ corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt:68— app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt:68-80 | app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt:85-94 | app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt:99-108 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) app/src/main/java/com/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt:83— app/src/main/java/com/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt:83-92 | app/src/main/java/com/sameerasw/essentials/island/plugins/soundmode/SoundModePlugin.kt:77-87 | app/src/main/java/com/sameerasw/essentials/island/plugins/timebattery/TimeBatteryPlugin.kt:163-173 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (32–33 lines × 2) app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt:118— app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt:118-150 | app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidget.kt:142-173 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt` and `app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidget.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/services/widgets/FavoritesWidget.kt:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (32–33 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:86— app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:86-118 | app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt:165-196 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (29–31 lines × 2) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:208— app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:208-238 | app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:352-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:208` it begins part-way through the construct above it, so those exact lines 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–31 lines × 2) app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt:343— app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt:343-371 | app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt:372-402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt:343` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1127— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1127-1155 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:587-615 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:788-816 — 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/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1127` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/ui/activities/YourAndroidActivity.kt:445— app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.kt:445-473 | app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.kt:479-507 | app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.kt:513-541 — 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/sameerasw/essentials/ui/activities/YourAndroidActivity.kt:445` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 3) app/src/main/java/com/sameerasw/essentials/services/tiles/AdaptiveBrightnessTileService.kt:25— app/src/main/java/com/sameerasw/essentials/services/tiles/AdaptiveBrightnessTileService.kt:25-47 | app/src/main/java/com/sameerasw/essentials/services/tiles/RefreshRateTileService.kt:27-49 | app/src/main/java/com/sameerasw/essentials/services/tiles/RestartSystemUiTileService.kt:27-49 — 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. 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 (23 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:136— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:136-158 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:131-153 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:101-123 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:241— app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:241-263 | app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:291-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:59— app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:59-81 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:61-83 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/UrlShortener.kt:457— app/src/main/java/com/sameerasw/essentials/utils/UrlShortener.kt:457-475 | app/src/main/java/com/sameerasw/essentials/utils/UrlShortener.kt:479-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/utils/UrlShortener.kt:457` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:1304— app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:1304-1321 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/FeatureHelpBottomSheet.kt:409-427 — 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/sameerasw/essentials/ui/activities/SettingsActivity.kt:1304` 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 × 2) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:648— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:648-665 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:924-939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:648` it begins part-way through the construct above it, so those exact lines 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–18 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:969— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:969-984 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:1180-1197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ActivityIconSheet.kt:186— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ActivityIconSheet.kt:186-202 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/HilightEffectSheet.kt:231-247 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetModeSettingsSheet.kt:182-198 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt:153-169 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetModeSettingsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/core/sheets/ActivityIconSheet.kt:186` 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/sameerasw/essentials/ui/core/sheets/HilightEffectSheet.kt:230` calls `stop` and `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ActivityIconSheet.kt:185` 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 × 4) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt:181— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt:181-197 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:96-112 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt:101-117 | app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/DimWallpaperSettingsSheet.kt:95-111 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15–17 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:285— app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:285-301 | app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:309-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:285` it begins part-way through the construct above it, so those exact lines 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–17 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:67— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt:67-81 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt:62-78 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AppIconPicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (10 lines × 5) app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:197— app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:197-206 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:216-226 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:247-257 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:304-314 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:348-358 — 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.
Duplicated block (10 lines × 5) app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt:164— app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt:164-173 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:193-202 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/ChargingModeSettingsSheet.kt:153-162 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt:290-301 | app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/DimWallpaperSettingsSheet.kt:219-228 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/ChargingModeSettingsSheet.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt:164` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 3) app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt:71— app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt:71-80 | app/src/main/java/com/sameerasw/essentials/services/widgets/WidgetScraperService.kt:339-348 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4951-4960 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt` and `app/src/main/java/com/sameerasw/essentials/services/widgets/WidgetScraperService.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:178— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:178-187 | app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:191-200 | app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:380-389 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:178` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) app/src/main/java/com/sameerasw/essentials/services/receivers/QsTileActionRouter.kt:91— app/src/main/java/com/sameerasw/essentials/services/receivers/QsTileActionRouter.kt:91-99 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:213-220 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:301-308 | app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:345-352 — 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/sameerasw/essentials/services/receivers/QsTileActionRouter.kt:91` it begins part-way through the construct above it, so those exact lines 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 × 4) app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:31— app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:31-38 | app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:58-65 | app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:85-92 | app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt:112-119 — 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/sameerasw/essentials/data/repository/GitHubRepository.kt:31` it does not close everything it opens, so those exact lines 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/sameerasw/essentials/services/automation/modules/AndroidAutoModule.kt:61— app/src/main/java/com/sameerasw/essentials/services/automation/modules/AndroidAutoModule.kt:61-69 | app/src/main/java/com/sameerasw/essentials/services/automation/modules/DisplayModule.kt:82-90 | app/src/main/java/com/sameerasw/essentials/services/automation/modules/PowerModule.kt:227-235 — 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/sameerasw/essentials/services/automation/modules/AndroidAutoModule.kt:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt:253— app/src/main/java/com/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt:253-261 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/HilightSettingsUI.kt:554-562 | app/src/main/java/com/sameerasw/essentials/ui/features/system/BackGestureSettingsUI.kt:584-592 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/BackGestureSettingsUI.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/features/audio/AppVolumeSettingsUI.kt:250` calls `formatLevel` and `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/HilightSettingsUI.kt:551` 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.
Low cohesion: MainViewModel (LCOM4 21) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:119— MainViewModel's methods fall into 21 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 21 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WatchViewModel (LCOM4 4) app/src/main/java/com/sameerasw/essentials/viewmodels/WatchViewModel.kt:19— WatchViewModel's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
IslandRootKt.IslandRootContent (cyclomatic 438) app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt:204— IslandRootKt.IslandRootContent has cyclomatic complexity 438 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FeatureSettingsActivityKt.FeatureSettingsScreen (cyclomatic 281) app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:172— FeatureSettingsActivityKt.FeatureSettingsScreen has cyclomatic complexity 281 (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.
KeyboardInputViewKt.KeyboardInputView (cyclomatic 227) app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:389— KeyboardInputViewKt.KeyboardInputView has cyclomatic complexity 227 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AutomationEditorActivityKt.AutomationEditorScreen (cyclomatic 191) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:127— AutomationEditorActivityKt.AutomationEditorScreen has cyclomatic complexity 191 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CombinedActionExecutor.execute (cyclomatic 172) REDACTED:164— CombinedActionExecutor.execute has cyclomatic complexity 172 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PixelSearchResultsActivityKt.PixelSearchResultsScreen (cyclomatic 145) app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:213— PixelSearchResultsActivityKt.PixelSearchResultsScreen has cyclomatic complexity 145 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DuoSettingsUIKt.DuoSettingsUI (cyclomatic 108) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:84— DuoSettingsUIKt.DuoSettingsUI has cyclomatic complexity 108 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MainActivity.onCreate (cyclomatic 101) app/src/main/java/com/sameerasw/essentials/MainActivity.kt:166— MainActivity.onCreate has cyclomatic complexity 101 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PermissionUIHelper.getPermissionItem (cyclomatic 95) app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt:30— PermissionUIHelper.getPermissionItem has cyclomatic complexity 95 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ActionSequenceEditorKt.ActionSequenceEditor (cyclomatic 93) app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:80— ActionSequenceEditorKt.ActionSequenceEditor has cyclomatic complexity 93 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatusGlanceSettingsUIKt.StatusGlanceSettingsUI (cyclomatic 90) app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:82— StatusGlanceSettingsUIKt.StatusGlanceSettingsUI has cyclomatic complexity 90 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SetupFeaturesKt.SetupFeatures (cyclomatic 83) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:96— SetupFeaturesKt.SetupFeatures has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NotificationListener.extractNotificationAlert (cyclomatic 78) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:2207— NotificationListener.extractNotificationAlert has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsActivityKt.SettingsContent (cyclomatic 77) app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:169— SettingsActivityKt.SettingsContent has cyclomatic complexity 77 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GestureActionPickerSheetKt.GestureActionPickerSheet (cyclomatic 75) app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:59— GestureActionPickerSheetKt.GestureActionPickerSheet has cyclomatic complexity 75 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PixelSearchbarSettingsActivityKt.PixelSearchbarSettingsUI (cyclomatic 70) app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:282— PixelSearchbarSettingsActivityKt.PixelSearchbarSettingsUI has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CompactTemplateKt.CompactTemplate (cyclomatic 66) app/src/main/java/com/sameerasw/essentials/island/ui/CompactTemplate.kt:109— CompactTemplateKt.CompactTemplate has cyclomatic complexity 66 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NotificationListener.onNotificationPostedInternal (cyclomatic 66) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1082— NotificationListener.onNotificationPostedInternal has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DuoOverlayView.onDraw (cyclomatic 65) app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1544— DuoOverlayView.onDraw has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BatteryInfoTabContentKt.BatteryInfoTabContent (cyclomatic 59) app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt:59— BatteryInfoTabContentKt.BatteryInfoTabContent has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LinkPickerAdapterKt.LinkPickerScreen (cyclomatic 58) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:207— LinkPickerAdapterKt.LinkPickerScreen has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GenAIFloatingPillKt.GenAIFloatingPill (cyclomatic 57) app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:79— GenAIFloatingPillKt.GenAIFloatingPill has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IslandSettingsUIKt.IslandSettingsUI (cyclomatic 56) app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt:109— IslandSettingsUIKt.IslandSettingsUI has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DIYViewModel.mapSuggestionToAutomation (cyclomatic 55) app/src/main/java/com/sameerasw/essentials/viewmodels/DIYViewModel.kt:159— DIYViewModel.mapSuggestionToAutomation has cyclomatic complexity 55 (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.
DuoOverlayView.getTargetColors (cyclomatic 51) app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1132— DuoOverlayView.getTargetColors has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AutomationManager.refreshModules (cyclomatic 47) app/src/main/java/com/sameerasw/essentials/services/automation/AutomationManager.kt:106— AutomationManager.refreshModules has cyclomatic complexity 47 (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.
StatusGlanceView.drawSlotContent (cyclomatic 46) app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:984— StatusGlanceView.drawSlotContent has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WallpaperScreenKt.WallpaperScreen (cyclomatic 45) app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt:130— WallpaperScreenKt.WallpaperScreen has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FeatureCardKt.FeatureCard (cyclomatic 44) app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureCard.kt:65— FeatureCardKt.FeatureCard has cyclomatic complexity 44 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DuoOverlayHandler.showOrUpdateOverlay (cyclomatic 43) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:816— DuoOverlayHandler.showOrUpdateOverlay has cyclomatic complexity 43 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatusBarIconSettingsUIKt.StatusBarIconSettingsUI (cyclomatic 43) app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:66— StatusBarIconSettingsUIKt.StatusBarIconSettingsUI has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DuoTouchHandler.onTouchEvent (cyclomatic 42) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoTouchHandler.kt:105— DuoTouchHandler.onTouchEvent has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EssentialsWearableListenerService.onMessageReceived (cyclomatic 41) app/src/main/java/com/sameerasw/essentials/services/EssentialsWearableListenerService.kt:27— EssentialsWearableListenerService.onMessageReceived has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CompactLayoutEngine.arrangeOnce (cyclomatic 40) app/src/main/java/com/sameerasw/essentials/island/state/CompactLayoutEngine.kt:132— CompactLayoutEngine.arrangeOnce 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.
FreezeSettingsUIKt.FreezeSettingsUI (cyclomatic 40) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt:79— FreezeSettingsUIKt.FreezeSettingsUI has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
QSPreferencesActivity.onCreate (cyclomatic 39) app/src/main/java/com/sameerasw/essentials/ui/activities/QSPreferencesActivity.kt:24— QSPreferencesActivity.onCreate has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MainViewModel.check (cyclomatic 38) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:1940— MainViewModel.check has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EssentialsInputMethodService.onCreateInputView (cyclomatic 37) app/src/main/java/com/sameerasw/essentials/ime/EssentialsInputMethodService.kt:134— EssentialsInputMethodService.onCreateInputView has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AmbientGlanceHandler.showOverlay (cyclomatic 37) app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:725— AmbientGlanceHandler.showOverlay has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NavigationSettingsUIKt.NavigationSettingsUI (cyclomatic 37) app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:52— NavigationSettingsUIKt.NavigationSettingsUI has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OtherCustomizationsSettingsUIKt.OtherCustomizationsSettingsUI (cyclomatic 37) app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:55— OtherCustomizationsSettingsUIKt.OtherCustomizationsSettingsUI has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FloatingWithFragmentKt.ShortenUrlSheet (cyclomatic 36) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:204— FloatingWithFragmentKt.ShortenUrlSheet has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LinkPickerAdapterKt.fetchLinkPreviewData (cyclomatic 36) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1278— LinkPickerAdapterKt.fetchLinkPreviewData has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SystemMetricSheetKt.SystemMetricSheet (cyclomatic 36) app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/SystemMetricSheet.kt:55— SystemMetricSheetKt.SystemMetricSheet has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NotificationLightingSettingsUIKt.NotificationLightingSettingsUI (cyclomatic 36) app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:86— NotificationLightingSettingsUIKt.NotificationLightingSettingsUI has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AmbientGlanceHandler.handleIntent (cyclomatic 35) app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:277— AmbientGlanceHandler.handleIntent has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IconToggleItemKt.IconToggleItem (cyclomatic 35) app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt:62— IconToggleItemKt.IconToggleItem has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PermissionCardKt.PermissionCard (cyclomatic 35) app/src/main/java/com/sameerasw/essentials/ui/core/cards/PermissionCard.kt:57— PermissionCardKt.PermissionCard has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BugReportBottomSheetKt.BugReportBottomSheet (cyclomatic 35) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:102— BugReportBottomSheetKt.BugReportBottomSheet has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AutomationItemKt.AutomationItem (cyclomatic 35) app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:78— AutomationItemKt.AutomationItem has cyclomatic complexity 35 (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.
BatteryStatsUtil.parseUsageApps (cyclomatic 34) app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryStatsUtil.kt:39— BatteryStatsUtil.parseUsageApps has cyclomatic complexity 34 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
IslandCoordinator.onSharedPreferenceChanged (cyclomatic 33) app/src/main/java/com/sameerasw/essentials/island/service/IslandCoordinator.kt:1057— IslandCoordinator.onSharedPreferenceChanged has cyclomatic complexity 33 (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.
ButtonRemapHandler.onKeyEvent (cyclomatic 33) app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt:75— ButtonRemapHandler.onKeyEvent has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Comparison.isActive (cyclomatic 32) app/src/main/java/com/sameerasw/essentials/domain/diy/Comparison.kt:70— Comparison.isActive has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WallpaperStagingScreenKt.WallpaperStagingScreen (cyclomatic 32) app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperStagingScreen.kt:89— WallpaperStagingScreenKt.WallpaperStagingScreen has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatusGlanceTouchHandler.onTouchEvent (cyclomatic 31) app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceTouchHandler.kt:87— StatusGlanceTouchHandler.onTouchEvent has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TravelCompassActivityKt.CompassScreen (cyclomatic 31) app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:174— TravelCompassActivityKt.CompassScreen has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ButtonRemapSettingsUIKt.ButtonRemapSettingsUI (cyclomatic 31) app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ButtonRemapSettingsUI.kt:77— ButtonRemapSettingsUIKt.ButtonRemapSettingsUI has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MediaExpandedKt.MediaExpanded (cyclomatic 30) app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaExpanded.kt:116— MediaExpandedKt.MediaExpanded has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LinkPickerAdapterKt.isAppRecommendedForUri (cyclomatic 30) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1431— LinkPickerAdapterKt.isAppRecommendedForUri has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SetupFeaturesKt.SearchResultsSection (cyclomatic 30) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:1355— SetupFeaturesKt.SearchResultsSection has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IslandController.recompute (cyclomatic 29) app/src/main/java/com/sameerasw/essentials/island/state/IslandController.kt:346— IslandController.recompute has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
NetworksSettingsUIKt.NetworksSettingsUI (cyclomatic 29) app/src/main/java/com/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt:60— NetworksSettingsUIKt.NetworksSettingsUI has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NotificationLightingHandler.showNotificationLighting (cyclomatic 28) app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:195— NotificationLightingHandler.showNotificationLighting has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UrlShortener.shortenUrl (cyclomatic 28) app/src/main/java/com/sameerasw/essentials/utils/UrlShortener.kt:299— UrlShortener.shortenUrl 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.
BaseEssentialsAppFunctionService.createAutomation (cyclomatic 27) app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:403— BaseEssentialsAppFunctionService.createAutomation has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
HiddenGestureDetector.onTouch (cyclomatic 27) app/src/main/java/com/sameerasw/essentials/island/gestures/HiddenGestureDetector.kt:59— HiddenGestureDetector.onTouch has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BriefPluginKt.BriefOverview (cyclomatic 27) app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:438— BriefPluginKt.BriefOverview has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppUpdatesActivity.onCreate (cyclomatic 27) app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:78— AppUpdatesActivity.onCreate has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AddRepoBottomSheetKt.AddRepoBottomSheet (cyclomatic 27) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AddRepoBottomSheet.kt:69— AddRepoBottomSheetKt.AddRepoBottomSheet has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NotificationLightingService.onStartCommand (cyclomatic 26) app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:122— NotificationLightingService.onStartCommand has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReusableTopAppBarKt.ReusableTopAppBar (cyclomatic 26) app/src/main/java/com/sameerasw/essentials/ui/components/ReusableTopAppBar.kt:55— ReusableTopAppBarKt.ReusableTopAppBar has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FreezeGridUIKt.FreezeGridUI (cyclomatic 26) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt:106— FreezeGridUIKt.FreezeGridUI has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WatchNotificationSyncManager.syncActiveNotifications (cyclomatic 25) app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:204— WatchNotificationSyncManager.syncActiveNotifications has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SimpleMarkdownKt.parseMarkdownToBlocks (cyclomatic 25) app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:158— SimpleMarkdownKt.parseMarkdownToBlocks has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
QuickSettingsTilesSettingsUIKt.QuickSettingsTilesSettingsUI (cyclomatic 25) app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:105— QuickSettingsTilesSettingsUIKt.QuickSettingsTilesSettingsUI 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.
WatchfaceSettingsUIKt.WatchfaceSettingsUI (cyclomatic 25) app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchfaceSettingsUI.kt:47— WatchfaceSettingsUIKt.WatchfaceSettingsUI has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
CalendarEventUtil.queryNextUpcomingEvent (cyclomatic 25) app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:71— CalendarEventUtil.queryNextUpcomingEvent has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileSearchUtil.searchFiles (cyclomatic 25) app/src/main/java/com/sameerasw/essentials/utils/FileSearchUtil.kt:27— FileSearchUtil.searchFiles 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.
NotificationListener.isLikedState (cyclomatic 24) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:740— NotificationListener.isLikedState 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.
AodWallpaperSettingsUIKt.AodWallpaperSettingsUI (cyclomatic 24) app/src/main/java/com/sameerasw/essentials/ui/features/display/AodWallpaperSettingsUI.kt:56— AodWallpaperSettingsUIKt.AodWallpaperSettingsUI has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IslandSubSettingsUIKt.IslandBehaviorSettingsUI (cyclomatic 24) app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:1004— IslandSubSettingsUIKt.IslandBehaviorSettingsUI has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatusGlanceView.calculateTargetWidth (cyclomatic 24) app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:814— StatusGlanceView.calculateTargetWidth has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HapticFeedbackUtilsKt.performHapticFeedback (cyclomatic 24) app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:26— HapticFeedbackUtilsKt.performHapticFeedback has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SettingsRepository.importConfigs (cyclomatic 23) app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:2051— SettingsRepository.importConfigs has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WatermarkEngine.processBitmap (cyclomatic 23) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:171— WatermarkEngine.processBitmap 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.
IslandStackKt.IslandStackPill (cyclomatic 23) app/src/main/java/com/sameerasw/essentials/island/ui/IslandStack.kt:542— IslandStackKt.IslandStackPill has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ScreenOffAccessibilityService.onStartCommand (cyclomatic 23) app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:1126— ScreenOffAccessibilityService.onStartCommand has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
EssentialsFloatingToolbarKt.EssentialsFloatingToolbar (cyclomatic 23) app/src/main/java/com/sameerasw/essentials/ui/components/EssentialsFloatingToolbar.kt:86— EssentialsFloatingToolbarKt.EssentialsFloatingToolbar 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.
FeatureHelpBottomSheetKt.FeatureHelpBottomSheet (cyclomatic 23) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/FeatureHelpBottomSheet.kt:90— FeatureHelpBottomSheetKt.FeatureHelpBottomSheet has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SoundModeTileSettingsUIKt.SoundModeTileSettingsUI (cyclomatic 23) app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:64— SoundModeTileSettingsUIKt.SoundModeTileSettingsUI has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NotificationsPlugin.onPosted (cyclomatic 22) app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:356— NotificationsPlugin.onPosted has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NotificationsPlugin.render (cyclomatic 22) app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:644— NotificationsPlugin.render has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IslandStackKt.IslandStackOverlap (cyclomatic 22) app/src/main/java/com/sameerasw/essentials/island/ui/IslandStack.kt:239— IslandStackKt.IslandStackOverlap 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.
StatusGlanceHandler.queryUpcomingCalendarEvent (cyclomatic 22) app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:516— StatusGlanceHandler.queryUpcomingCalendarEvent has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PrivateDnsTileService.onTileClick (cyclomatic 22) app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateDnsTileService.kt:83— PrivateDnsTileService.onTileClick has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QuickSettingsTilesSettingsUIKt.QSTileCard (cyclomatic 22) app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:502— QuickSettingsTilesSettingsUIKt.QSTileCard 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.
SnippetExpansionEngine.checkAndExpand (cyclomatic 21) app/src/main/java/com/sameerasw/essentials/ime/SnippetExpansionEngine.kt:19— SnippetExpansionEngine.checkAndExpand has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WatchNotificationSyncManager.onNotificationPosted (cyclomatic 21) app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:107— WatchNotificationSyncManager.onNotificationPosted 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.
FlashlightHandler.toggleFlashlight (cyclomatic 21) app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:610— FlashlightHandler.toggleFlashlight has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ScreenOffAccessibilityService.onSensorChanged (cyclomatic 21) app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:948— ScreenOffAccessibilityService.onSensorChanged has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LocationTriggerSheetKt.LocationTriggerSheet (cyclomatic 21) app/src/main/java/com/sameerasw/essentials/ui/features/location/sheets/LocationTriggerSheet.kt:68— LocationTriggerSheetKt.LocationTriggerSheet 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.
DuoOverlayView.animateLayoutChange (cyclomatic 21) app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1369— DuoOverlayView.animateLayoutChange 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.
MediaPlugin.evaluate (cyclomatic 20) app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaPlugin.kt:109— MediaPlugin.evaluate 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.
TimeBatteryPlugin.render (cyclomatic 20) app/src/main/java/com/sameerasw/essentials/island/plugins/timebattery/TimeBatteryPlugin.kt:236— TimeBatteryPlugin.render has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
CalendarSyncManager.syncEventsBlocking (cyclomatic 20) app/src/main/java/com/sameerasw/essentials/services/CalendarSyncManager.kt:111— CalendarSyncManager.syncEventsBlocking 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.
NotificationLightingService.showOverlay (cyclomatic 20) app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:334— NotificationLightingService.showOverlay 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.
AppFlowHandler.checkAppLock (cyclomatic 20) app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:269— AppFlowHandler.checkAppLock 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.
PixelSearchbarWidget.provideGlance (cyclomatic 20) app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidget.kt:64— PixelSearchbarWidget.provideGlance 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.
ShutUpShortcutActivity.applyShutUpSettings (cyclomatic 20) app/src/main/java/com/sameerasw/essentials/ui/activities/ShutUpShortcutActivity.kt:112— ShutUpShortcutActivity.applyShutUpSettings 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.
FeatureHelpMediaViewerKt.FullScreenMediaDialog (cyclomatic 20) app/src/main/java/com/sameerasw/essentials/ui/core/media/FeatureHelpMediaViewer.kt:234— FeatureHelpMediaViewerKt.FullScreenMediaDialog 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.
QSTilesSearchResultCardKt.QSTilesSearchResultCard (cyclomatic 20) app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:72— QSTilesSearchResultCardKt.QSTilesSearchResultCard 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.
DeviceUtils.getOSName (cyclomatic 20) app/src/main/java/com/sameerasw/essentials/utils/DeviceUtils.kt:201— DeviceUtils.getOSName has cyclomatic complexity 20 (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.
ChronometerRepository.onPosted (cyclomatic 20) app/src/main/java/com/sameerasw/essentials/utils/chronometer/ChronometerRepository.kt:128— ChronometerRepository.onPosted 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.
HilightFrames.patternFrame (cyclomatic 19) app/src/main/java/com/sameerasw/essentials/domain/model/HilightEffect.kt:129— HilightFrames.patternFrame 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.
BriefPluginKt.BriefExpanded (cyclomatic 19) app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:210— BriefPluginKt.BriefExpanded 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.
MediaSurfaceBackdropKt.MediaSurface (cyclomatic 19) app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaSurfaceBackdrop.kt:84— MediaSurfaceBackdropKt.MediaSurface 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.
GeminiParticlePillKt.GeminiParticlePill (cyclomatic 19) app/src/main/java/com/sameerasw/essentials/island/plugins/media/particles/GeminiParticlePill.kt:42— GeminiParticlePillKt.GeminiParticlePill 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.
CompactInteractionKt.detectCompactGestures (cyclomatic 19) app/src/main/java/com/sameerasw/essentials/island/ui/CompactInteraction.kt:63— CompactInteractionKt.detectCompactGestures 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.
NotificationListener.extractProgressNotification (cyclomatic 19) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1895— NotificationListener.extractProgressNotification 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.
AppFlowHandler.restoreShutUpSettings (cyclomatic 19) app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:1021— AppFlowHandler.restoreShutUpSettings 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.
DuoOverlayHandler.isFastCharging (cyclomatic 19) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:190— DuoOverlayHandler.isFastCharging 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.
DuoTouchHandler.handleHorizontalSlide (cyclomatic 19) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoTouchHandler.kt:285— DuoTouchHandler.handleHorizontalSlide 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.
AutomationItemKt.automationSummary (cyclomatic 19) app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:421— AutomationItemKt.automationSummary has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FreezeGridUIKt.AppGridItem (cyclomatic 19) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt:536— FreezeGridUIKt.AppGridItem 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.
WatermarkEngine.drawFrameContent (cyclomatic 18) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:666— WatermarkEngine.drawFrameContent has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IslandCoordinator.applyConfig (cyclomatic 18) app/src/main/java/com/sameerasw/essentials/island/service/IslandCoordinator.kt:795— IslandCoordinator.applyConfig has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LocationReachedService.buildOngoingNotification (cyclomatic 18) app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:400— LocationReachedService.buildOngoingNotification has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AmbientDreamService.handleIntent (cyclomatic 18) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:675— AmbientDreamService.handleIntent 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.
AodWallpaperOverlayHandler.checkAndApplyMediaState (cyclomatic 18) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:159— AodWallpaperOverlayHandler.checkAndApplyMediaState 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.
SnippetExpansionHandler.onTextChanged (cyclomatic 18) app/src/main/java/com/sameerasw/essentials/services/handlers/SnippetExpansionHandler.kt:34— SnippetExpansionHandler.onTextChanged has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StandbyAppsSettingsUIKt.StandbyAppsSettingsUI (cyclomatic 18) app/src/main/java/com/sameerasw/essentials/ui/features/apps/StandbyAppsSettingsUI.kt:65— StandbyAppsSettingsUIKt.StandbyAppsSettingsUI 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.
BatteryAppsTabContentKt.BatteryAppsTabContent (cyclomatic 18) app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryAppsTabContent.kt:58— BatteryAppsTabContentKt.BatteryAppsTabContent 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.
WatchWirelessDebuggingSettingsUIKt.WatchWirelessDebuggingSettingsUI (cyclomatic 18) app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchWirelessDebuggingSettingsUI.kt:53— WatchWirelessDebuggingSettingsUIKt.WatchWirelessDebuggingSettingsUI has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UnderlayBlurKt.UnderlayBlur (cyclomatic 18) app/src/main/java/com/sameerasw/essentials/ui/navigation/UnderlayBlur.kt:44— UnderlayBlurKt.UnderlayBlur has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BatteryInfoUtil.getBasicDetails (cyclomatic 18) app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryInfoUtil.kt:71— BatteryInfoUtil.getBasicDetails 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.
NavigationTrigger.decide (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/island/plugins/navigation/NavigationPlugin.kt:234— NavigationTrigger.decide has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NotificationExpandedKt.ActionBar (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationExpanded.kt:228— NotificationExpandedKt.ActionBar has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NotificationListener.handleMediaUpdate (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:949— NotificationListener.handleMediaUpdate has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AmbientDreamService.setupContentUI (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:267— AmbientDreamService.setupContentUI has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AmbientDreamService.updateAlbumArt (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1177— AmbientDreamService.updateAlbumArt has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TranslationBottomSheetKt.TranslationBottomSheet (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt:61— TranslationBottomSheetKt.TranslationBottomSheet has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TranslationSessionSheetKt.TranslationSessionSheet (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationSessionSheet.kt:65— TranslationSessionSheetKt.TranslationSessionSheet has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AppToggleItemKt.AppToggleItem (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:85— AppToggleItemKt.AppToggleItem has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UpdateBottomSheetKt.UpdateBottomSheet (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/UpdateBottomSheet.kt:71— UpdateBottomSheetKt.UpdateBottomSheet has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AppSelectionSheetsKt.AppSelectionSheet (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:68— AppSelectionSheetsKt.AppSelectionSheet has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatusGlanceCalendarOptionsBottomSheetKt.StatusGlanceCalendarOptionsBottomSheet (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/StatusGlanceCalendarOptionsBottomSheet.kt:51— StatusGlanceCalendarOptionsBottomSheetKt.StatusGlanceCalendarOptionsBottomSheet has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LockscreenShortcutsSettingsUIKt.LockscreenShortcutsSettingsUI (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/ui/features/system/LockscreenShortcutsSettingsUI.kt:55— LockscreenShortcutsSettingsUIKt.LockscreenShortcutsSettingsUI has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WatchNotificationSettingsUIKt.WatchNotificationSettingsUI (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchNotificationSettingsUI.kt:48— WatchNotificationSettingsUIKt.WatchNotificationSettingsUI has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CallNotificationParser.parse (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/utils/call/CallNotificationParser.kt:70— CallNotificationParser.parse has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppUpdatesViewModel.parseImportedRepos (cyclomatic 17) app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:770— AppUpdatesViewModel.parseImportedRepos has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsRepository.syncSystemSettingsWithSaved (cyclomatic 16) app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:3208— SettingsRepository.syncSystemSettingsWithSaved has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: SettingsRepository.migrateRemapStringToAction (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
SystemMetricTracker.updateAutomations (cyclomatic 16) app/src/main/java/com/sameerasw/essentials/domain/diy/SystemMetricTracker.kt:69— SystemMetricTracker.updateAutomations has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WatermarkEngine.drawOverlay (cyclomatic 16) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:392— WatermarkEngine.drawOverlay has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemoteExpandedKt.RemoteExpanded (cyclomatic 16) app/src/main/java/com/sameerasw/essentials/island/remote/RemoteExpanded.kt:44— RemoteExpandedKt.RemoteExpanded 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.
InputEventListenerService.startVolumeListening (cyclomatic 16) app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt:267— InputEventListenerService.startVolumeListening has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TranslationValidator.validate (cyclomatic 16) app/src/main/java/com/sameerasw/essentials/translation/TranslationValidator.kt:63— TranslationValidator.validate has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SimpleMarkdownKt.parseMarkdown (cyclomatic 16) app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:610— SimpleMarkdownKt.parseMarkdown has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BatteryDetailsBottomSheetKt.BatteryDetailsBottomSheet (cyclomatic 16) app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/BatteryDetailsBottomSheet.kt:76— BatteryDetailsBottomSheetKt.BatteryDetailsBottomSheet has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
LocationReachedSettingsUIKt.TopStatusCard (cyclomatic 16) app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationReachedSettingsUI.kt:274— LocationReachedSettingsUIKt.TopStatusCard has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WatermarkPreviewAreaKt.WatermarkPreviewArea (cyclomatic 16) app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkPreviewArea.kt:64— WatermarkPreviewAreaKt.WatermarkPreviewArea 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.
HapticUtil.performCustomHaptic (cyclomatic 16) app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:354— HapticUtil.performCustomHaptic 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.
IslandRootKt.IslandRootContent (cognitive 695) app/src/main/java/com/sameerasw/essentials/island/ui/IslandRoot.kt:204— IslandRootKt.IslandRootContent has cognitive complexity 695 (threshold 15). Drivers by points: if/else 416 (532 pts), boolean chains 134, match/switch 21 (25 pts), loops 3, error handling 1 (nesting depth added 120). 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.
KeyboardInputViewKt.KeyboardInputView (cognitive 514) app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:389— KeyboardInputViewKt.KeyboardInputView has cognitive complexity 514 (threshold 15). Drivers by points: if/else 235 (449 pts), boolean chains 37, match/switch 7 (19 pts), loops 4 (7 pts), error handling 1 (2 pts) (nesting depth added 230). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutomationEditorActivityKt.AutomationEditorScreen (cognitive 273) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:127— AutomationEditorActivityKt.AutomationEditorScreen has cognitive complexity 273 (threshold 15). Drivers by points: if/else 126 (189 pts), match/switch 21 (43 pts), boolean chains 37, error handling 2 (4 pts) (nesting depth added 87). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CombinedActionExecutor.execute (cognitive 233) REDACTED:164— CombinedActionExecutor.execute has cognitive complexity 233 (threshold 15). Drivers by points: if/else 76 (159 pts), error handling 18 (49 pts), match/switch 8 (19 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 127). 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.
PixelSearchResultsActivityKt.PixelSearchResultsScreen (cognitive 221) app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:213— PixelSearchResultsActivityKt.PixelSearchResultsScreen has cognitive complexity 221 (threshold 15). Drivers by points: if/else 102 (161 pts), boolean chains 57, match/switch 3 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PermissionUIHelper.getPermissionItem (cognitive 199) app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt:30— PermissionUIHelper.getPermissionItem has cognitive complexity 199 (threshold 15). Drivers by points: if/else 110 (185 pts), loops 3 (9 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (nesting depth added 82). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
DuoOverlayView.onDraw (cognitive 188) app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1544— DuoOverlayView.onDraw has cognitive complexity 188 (threshold 15). Drivers by points: if/else 54 (161 pts), boolean chains 18, loops 2 (6 pts), match/switch 1 (3 pts) (nesting depth added 113). 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.
FeatureSettingsActivityKt.FeatureSettingsScreen (cognitive 187) app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:172— FeatureSettingsActivityKt.FeatureSettingsScreen has cognitive complexity 187 (threshold 15). Drivers by points: if/else 90 (120 pts), boolean chains 52, match/switch 8 (12 pts), loops 1 (2 pts), error handling 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationListener.extractNotificationAlert (cognitive 153) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:2207— NotificationListener.extractNotificationAlert has cognitive complexity 153 (threshold 15). Drivers by points: if/else 60 (117 pts), error handling 9 (18 pts), boolean chains 15, loops 1 (2 pts), match/switch 1 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainActivity.onCreate (cognitive 144) app/src/main/java/com/sameerasw/essentials/MainActivity.kt:166— MainActivity.onCreate has cognitive complexity 144 (threshold 15). Drivers by points: if/else 91 (112 pts), boolean chains 15, match/switch 5 (9 pts), error handling 7 (8 pts) (nesting depth added 26). 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.
SetupFeaturesKt.SetupFeatures (cognitive 131) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:96— SetupFeaturesKt.SetupFeatures has cognitive complexity 131 (threshold 15). Drivers by points: if/else 54 (114 pts), boolean chains 12, match/switch 2 (4 pts), loops 1 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsActivityKt.SettingsContent (cognitive 124) app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt:169— SettingsActivityKt.SettingsContent has cognitive complexity 124 (threshold 15). Drivers by points: if/else 80 (96 pts), match/switch 3 (14 pts), boolean chains 10, error handling 3 (4 pts) (nesting depth added 28). 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.
NotificationListener.onNotificationPostedInternal (cognitive 122) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1082— NotificationListener.onNotificationPostedInternal has cognitive complexity 122 (threshold 15). Drivers by points: if/else 42 (64 pts), error handling 13 (45 pts), boolean chains 13 (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.
CompactTemplateKt.CompactTemplate (cognitive 118) app/src/main/java/com/sameerasw/essentials/island/ui/CompactTemplate.kt:109— CompactTemplateKt.CompactTemplate has cognitive complexity 118 (threshold 15). Drivers by points: if/else 81 (100 pts), boolean chains 14, loops 2, match/switch 2 (nesting depth added 19). 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.
PixelSearchbarSettingsActivityKt.PixelSearchbarSettingsUI (cognitive 117) app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:282— PixelSearchbarSettingsActivityKt.PixelSearchbarSettingsUI has cognitive complexity 117 (threshold 15). Drivers by points: if/else 67 (95 pts), boolean chains 11, match/switch 4 (7 pts), error handling 2 (3 pts), loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatteryInfoTabContentKt.BatteryInfoTabContent (cognitive 110) app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt:59— BatteryInfoTabContentKt.BatteryInfoTabContent has cognitive complexity 110 (threshold 15). Drivers by points: if/else 58 (97 pts), boolean chains 10, match/switch 2 (3 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuoSettingsUIKt.DuoSettingsUI (cognitive 109) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:84— DuoSettingsUIKt.DuoSettingsUI has cognitive complexity 109 (threshold 15). Drivers by points: if/else 65 (75 pts), boolean chains 25, match/switch 6 (9 pts) (nesting depth added 13). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StatusGlanceView.drawSlotContent (cognitive 106) app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:984— StatusGlanceView.drawSlotContent has cognitive complexity 106 (threshold 15). Drivers by points: if/else 47 (90 pts), match/switch 3 (10 pts), boolean chains 6 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuoOverlayView.getTargetColors (cognitive 99) app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1132— DuoOverlayView.getTargetColors has cognitive complexity 99 (threshold 15). Drivers by points: if/else 48 (80 pts), boolean chains 19 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LinkPickerAdapterKt.LinkPickerScreen (cognitive 98) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:207— LinkPickerAdapterKt.LinkPickerScreen has cognitive complexity 98 (threshold 15). Drivers by points: if/else 53 (76 pts), boolean chains 11, error handling 5 (10 pts), match/switch 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WallpaperScreenKt.WallpaperScreen (cognitive 98) app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt:130— WallpaperScreenKt.WallpaperScreen has cognitive complexity 98 (threshold 15). Drivers by points: if/else 49 (82 pts), boolean chains 7, error handling 4 (7 pts), loops 1, match/switch 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IconToggleItemKt.IconToggleItem (cognitive 88) app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt:62— IconToggleItemKt.IconToggleItem has cognitive complexity 88 (threshold 15). Drivers by points: if/else 44 (84 pts), boolean chains 4 (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.
StatusGlanceSettingsUIKt.StatusGlanceSettingsUI (cognitive 86) app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:82— StatusGlanceSettingsUIKt.StatusGlanceSettingsUI has cognitive complexity 86 (threshold 15). Drivers by points: if/else 48 (57 pts), boolean chains 21, match/switch 5 (8 pts) (nesting depth added 12). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AmbientGlanceHandler.handleIntent (cognitive 82) app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:277— AmbientGlanceHandler.handleIntent has cognitive complexity 82 (threshold 15). Drivers by points: if/else 31 (72 pts), boolean chains 7, error handling 1 (3 pts) (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.
FloatingWithFragmentKt.ShortenUrlSheet (cognitive 82) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:204— FloatingWithFragmentKt.ShortenUrlSheet has cognitive complexity 82 (threshold 15). Drivers by points: if/else 28 (46 pts), error handling 14 (32 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SetupFeaturesKt.SearchResultsSection (cognitive 79) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:1355— SetupFeaturesKt.SearchResultsSection has cognitive complexity 79 (threshold 15). Drivers by points: if/else 31 (69 pts), boolean chains 7, loops 1 (3 pts) (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ActionSequenceEditorKt.ActionSequenceEditor (cognitive 79) app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:80— ActionSequenceEditorKt.ActionSequenceEditor has cognitive complexity 79 (threshold 15). Drivers by points: if/else 48 (55 pts), boolean chains 20, match/switch 3 (4 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DuoTouchHandler.onTouchEvent (cognitive 78) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoTouchHandler.kt:105— DuoTouchHandler.onTouchEvent has cognitive complexity 78 (threshold 15). Drivers by points: if/else 30 (64 pts), boolean chains 13, match/switch 1 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CompactLayoutEngine.arrangeOnce (cognitive 74) app/src/main/java/com/sameerasw/essentials/island/state/CompactLayoutEngine.kt:132— CompactLayoutEngine.arrangeOnce has cognitive complexity 74 (threshold 15). Drivers by points: if/else 32 (55 pts), boolean chains 13, loops 3 (6 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.
DuoOverlayHandler.showOrUpdateOverlay (cognitive 73) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:816— DuoOverlayHandler.showOrUpdateOverlay has cognitive complexity 73 (threshold 15). Drivers by points: if/else 34 (45 pts), error handling 9 (17 pts), boolean chains 6, match/switch 2 (5 pts) (nesting depth added 22). 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.
FeatureCardKt.FeatureCard (cognitive 73) app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureCard.kt:65— FeatureCardKt.FeatureCard has cognitive complexity 73 (threshold 15). Drivers by points: if/else 48 (61 pts), boolean chains 6, error handling 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 16). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GestureActionPickerSheetKt.GestureActionPickerSheet (cognitive 71) app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:59— GestureActionPickerSheetKt.GestureActionPickerSheet has cognitive complexity 71 (threshold 15). Drivers by points: if/else 38 (47 pts), boolean chains 19, match/switch 3 (5 pts) (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FavoritesWidget.provideGlance (cognitive 69) app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt:62— FavoritesWidget.provideGlance has cognitive complexity 69 (threshold 15). Drivers by points: if/else 24 (63 pts), loops 2 (6 pts) (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.
GenAIFloatingPillKt.GenAIFloatingPill (cognitive 69) app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt:79— GenAIFloatingPillKt.GenAIFloatingPill has cognitive complexity 69 (threshold 15). Drivers by points: if/else 28 (51 pts), match/switch 4 (10 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EssentialsWearableListenerService.onMessageReceived (cognitive 68) app/src/main/java/com/sameerasw/essentials/services/EssentialsWearableListenerService.kt:27— EssentialsWearableListenerService.onMessageReceived has cognitive complexity 68 (threshold 15). Drivers by points: if/else 18 (41 pts), error handling 8 (22 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 38). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
NotificationLightingHandler.showNotificationLighting (cognitive 67) app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:195— NotificationLightingHandler.showNotificationLighting has cognitive complexity 67 (threshold 15). Drivers by points: if/else 26 (47 pts), error handling 4 (11 pts), match/switch 2 (6 pts), boolean chains 3 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TravelCompassActivityKt.CompassScreen (cognitive 67) app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:174— TravelCompassActivityKt.CompassScreen has cognitive complexity 67 (threshold 15). Drivers by points: if/else 32 (61 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemMetricSheetKt.SystemMetricSheet (cognitive 65) app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/SystemMetricSheet.kt:55— SystemMetricSheetKt.SystemMetricSheet has cognitive complexity 65 (threshold 15). Drivers by points: if/else 40 (57 pts), boolean chains 7, error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusBarIconSettingsUIKt.StatusBarIconSettingsUI (cognitive 65) app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:66— StatusBarIconSettingsUIKt.StatusBarIconSettingsUI has cognitive complexity 65 (threshold 15). Drivers by points: if/else 37 (50 pts), boolean chains 11, match/switch 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IslandSettingsUIKt.IslandSettingsUI (cognitive 62) app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt:109— IslandSettingsUIKt.IslandSettingsUI has cognitive complexity 62 (threshold 15). Drivers by points: if/else 39 (54 pts), boolean chains 7, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmbientGlanceHandler.showOverlay (cognitive 61) app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:725— AmbientGlanceHandler.showOverlay has cognitive complexity 61 (threshold 15). Drivers by points: if/else 52 (55 pts), error handling 4 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AddRepoBottomSheetKt.AddRepoBottomSheet (cognitive 60) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AddRepoBottomSheet.kt:69— AddRepoBottomSheetKt.AddRepoBottomSheet has cognitive complexity 60 (threshold 15). Drivers by points: if/else 33 (55 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrivateDnsTileService.onTileClick (cognitive 58) app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateDnsTileService.kt:83— PrivateDnsTileService.onTileClick has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (35 pts), error handling 5 (16 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FreezeGridUIKt.FreezeGridUI (cognitive 58) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt:106— FreezeGridUIKt.FreezeGridUI has cognitive complexity 58 (threshold 15). Drivers by points: if/else 28 (46 pts), error handling 2 (7 pts), boolean chains 5 (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.
MediaExpandedKt.MediaExpanded (cognitive 57) app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaExpanded.kt:116— MediaExpandedKt.MediaExpanded has cognitive complexity 57 (threshold 15). Drivers by points: if/else 38 (52 pts), boolean chains 2, match/switch 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationLightingSettingsUIKt.NotificationLightingSettingsUI (cognitive 57) app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:86— NotificationLightingSettingsUIKt.NotificationLightingSettingsUI has cognitive complexity 57 (threshold 15). Drivers by points: if/else 33 (46 pts), loops 2 (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.
AppUpdatesActivity.onCreate (cognitive 56) app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:78— AppUpdatesActivity.onCreate has cognitive complexity 56 (threshold 15). Drivers by points: if/else 32 (50 pts), boolean chains 4, error handling 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FreezeSettingsUIKt.FreezeSettingsUI (cognitive 56) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt:79— FreezeSettingsUIKt.FreezeSettingsUI has cognitive complexity 56 (threshold 15). Drivers by points: if/else 35 (42 pts), boolean chains 6, error handling 3 (4 pts), match/switch 3 (4 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.
SnippetExpansionEngine.checkAndExpand (cognitive 55) app/src/main/java/com/sameerasw/essentials/ime/SnippetExpansionEngine.kt:19— SnippetExpansionEngine.checkAndExpand has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (49 pts), boolean chains 5, loops 1 (nesting depth added 31). 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.
QsTilesWidget.provideGlance (cognitive 55) app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidget.kt:67— QsTilesWidget.provideGlance has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (46 pts), loops 2 (6 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NavigationSettingsUIKt.NavigationSettingsUI (cognitive 55) app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:52— NavigationSettingsUIKt.NavigationSettingsUI has cognitive complexity 55 (threshold 15). Drivers by points: if/else 35 (43 pts), boolean chains 10, 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.
FlashlightHandler.toggleFlashlight (cognitive 52) app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:610— FlashlightHandler.toggleFlashlight has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (43 pts), error handling 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
PermissionCardKt.PermissionCard (cognitive 52) app/src/main/java/com/sameerasw/essentials/ui/core/cards/PermissionCard.kt:57— PermissionCardKt.PermissionCard has cognitive complexity 52 (threshold 15). Drivers by points: if/else 28 (39 pts), match/switch 7 (9 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ButtonRemapSettingsUIKt.ButtonRemapSettingsUI (cognitive 52) app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ButtonRemapSettingsUI.kt:77— ButtonRemapSettingsUIKt.ButtonRemapSettingsUI has cognitive complexity 52 (threshold 15). Drivers by points: if/else 35 (44 pts), boolean chains 5, error handling 1 (2 pts), match/switch 1 (nesting depth added 10). 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.
LinkPickerAdapterKt.fetchLinkPreviewData (cognitive 51) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1278— LinkPickerAdapterKt.fetchLinkPreviewData has cognitive complexity 51 (threshold 15). Drivers by points: if/else 30 (41 pts), boolean chains 8, error handling 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BugReportBottomSheetKt.BugReportBottomSheet (cognitive 51) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt:102— BugReportBottomSheetKt.BugReportBottomSheet has cognitive complexity 51 (threshold 15). Drivers by points: if/else 34 (37 pts), error handling 8 (11 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
MainViewModel.check (cognitive 51) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:1940— MainViewModel.check has cognitive complexity 51 (threshold 15). Drivers by points: if/else 26 (33 pts), error handling 10 (12 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 10). 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.
OtherCustomizationsSettingsUIKt.OtherCustomizationsSettingsUI (cognitive 50) app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:55— OtherCustomizationsSettingsUIKt.OtherCustomizationsSettingsUI has cognitive complexity 50 (threshold 15). Drivers by points: if/else 30 (38 pts), boolean chains 10, 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.
NetworksSettingsUIKt.NetworksSettingsUI (cognitive 48) app/src/main/java/com/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt:60— NetworksSettingsUIKt.NetworksSettingsUI has cognitive complexity 48 (threshold 15). Drivers by points: if/else 30 (39 pts), boolean chains 9 (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.
WatermarkEngine.processBitmap (cognitive 47) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:171— WatermarkEngine.processBitmap has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (38 pts), error handling 2 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EssentialsInputMethodService.onCreateInputView (cognitive 47) app/src/main/java/com/sameerasw/essentials/ime/EssentialsInputMethodService.kt:134— EssentialsInputMethodService.onCreateInputView has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (43 pts), boolean chains 3, match/switch 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ButtonRemapHandler.onKeyEvent (cognitive 46) app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt:75— ButtonRemapHandler.onKeyEvent has cognitive complexity 46 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 13, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EssentialsFloatingToolbarKt.EssentialsFloatingToolbar (cognitive 46) app/src/main/java/com/sameerasw/essentials/ui/components/EssentialsFloatingToolbar.kt:86— EssentialsFloatingToolbarKt.EssentialsFloatingToolbar has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (41 pts), boolean chains 4, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WallpaperStagingScreenKt.WallpaperStagingScreen (cognitive 46) app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperStagingScreen.kt:89— WallpaperStagingScreenKt.WallpaperStagingScreen has cognitive complexity 46 (threshold 15). Drivers by points: if/else 30 (37 pts), boolean chains 7, loops 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NotificationLightingService.showOverlay (cognitive 44) app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:334— NotificationLightingService.showOverlay has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (33 pts), error handling 2 (5 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusGlanceTouchHandler.onTouchEvent (cognitive 44) app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceTouchHandler.kt:87— StatusGlanceTouchHandler.onTouchEvent has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 12, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
QSPreferencesActivity.onCreate (cognitive 44) app/src/main/java/com/sameerasw/essentials/ui/activities/QSPreferencesActivity.kt:24— QSPreferencesActivity.onCreate has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (40 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationLightingService.onStartCommand (cognitive 43) app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:122— NotificationLightingService.onStartCommand has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (25 pts), error handling 6 (13 pts), boolean chains 5 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PixelSearchbarWidget.provideGlance (cognitive 43) app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidget.kt:64— PixelSearchbarWidget.provideGlance has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (39 pts), boolean chains 3, match/switch 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.
IslandStackKt.IslandStackOverlap (cognitive 42) app/src/main/java/com/sameerasw/essentials/island/ui/IslandStack.kt:239— IslandStackKt.IslandStackOverlap has cognitive complexity 42 (threshold 15). Drivers by points: if/else 33 (38 pts), boolean chains 4 (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.
LocationReachedService.buildOngoingNotification (cognitive 41) app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:400— LocationReachedService.buildOngoingNotification has cognitive complexity 41 (threshold 15). Drivers by points: if/else 29 (36 pts), error handling 2 (5 pts) (nesting depth added 10). 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.
CalendarSyncManager.syncEventsBlocking (cognitive 40) app/src/main/java/com/sameerasw/essentials/services/CalendarSyncManager.kt:111— CalendarSyncManager.syncEventsBlocking has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (27 pts), error handling 3 (8 pts), boolean chains 4, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationListener.isLikedState (cognitive 40) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:740— NotificationListener.isLikedState has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 10, loops 2 (5 pts), error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReusableTopAppBarKt.ReusableTopAppBar (cognitive 40) app/src/main/java/com/sameerasw/essentials/ui/components/ReusableTopAppBar.kt:55— ReusableTopAppBarKt.ReusableTopAppBar has cognitive complexity 40 (threshold 15). Drivers by points: if/else 25 (34 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainViewModel.loadCurrentWallpaperBitmap (cognitive 40) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:10062— MainViewModel.loadCurrentWallpaperBitmap has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 2, error handling 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IslandStackKt.IslandStackPill (cognitive 39) app/src/main/java/com/sameerasw/essentials/island/ui/IslandStack.kt:542— IslandStackKt.IslandStackPill has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FeatureHelpMediaViewerKt.FullScreenMediaDialog (cognitive 39) app/src/main/java/com/sameerasw/essentials/ui/core/media/FeatureHelpMediaViewer.kt:234— FeatureHelpMediaViewerKt.FullScreenMediaDialog has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (34 pts), boolean chains 4, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BriefPluginKt.BriefOverview (cognitive 38) app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:438— BriefPluginKt.BriefOverview has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27 (31 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
InputEventListenerService.startVolumeListening (cognitive 38) app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt:267— InputEventListenerService.startVolumeListening has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 2, error handling 2 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IslandSubSettingsUIKt.IslandBehaviorSettingsUI (cognitive 38) app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt:1004— IslandSubSettingsUIKt.IslandBehaviorSettingsUI has cognitive complexity 38 (threshold 15). Drivers by points: if/else 26 (29 pts), boolean chains 9 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
UrlShortener.shortenUrl (cognitive 38) app/src/main/java/com/sameerasw/essentials/utils/UrlShortener.kt:299— UrlShortener.shortenUrl has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (21 pts), error handling 9 (14 pts), boolean chains 3 (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.
WatchNotificationSyncManager.syncActiveNotifications (cognitive 37) app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:204— WatchNotificationSyncManager.syncActiveNotifications has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 9, error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppUpdatesViewModel.parseImportedRepos (cognitive 37) app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:770— AppUpdatesViewModel.parseImportedRepos has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (24 pts), error handling 4 (9 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranslationBottomSheetKt.TranslationBottomSheet (cognitive 36) app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt:61— TranslationBottomSheetKt.TranslationBottomSheet has cognitive complexity 36 (threshold 15). Drivers by points: if/else 25 (34 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StandbyAppsSettingsUIKt.StandbyAppsSettingsUI (cognitive 36) app/src/main/java/com/sameerasw/essentials/ui/features/apps/StandbyAppsSettingsUI.kt:65— StandbyAppsSettingsUIKt.StandbyAppsSettingsUI has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatteryAppsTabContentKt.BatteryAppsTabContent (cognitive 36) app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryAppsTabContent.kt:58— BatteryAppsTabContentKt.BatteryAppsTabContent has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocationReachedSettingsUIKt.TopStatusCard (cognitive 36) app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationReachedSettingsUI.kt:274— LocationReachedSettingsUIKt.TopStatusCard has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23 (34 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuickSettingsTilesSettingsUIKt.QSTileCard (cognitive 36) app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:502— QuickSettingsTilesSettingsUIKt.QSTileCard has cognitive complexity 36 (threshold 15). Drivers by points: if/else 26 (33 pts), boolean chains 3 (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.
DuoOverlayView.animateLayoutChange (cognitive 36) app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1369— DuoOverlayView.animateLayoutChange has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24 (29 pts), boolean chains 7 (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.
SystemMetricTracker.updateAutomations (cognitive 35) app/src/main/java/com/sameerasw/essentials/domain/diy/SystemMetricTracker.kt:69— SystemMetricTracker.updateAutomations has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationListener.handleMediaUpdate (cognitive 35) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:949— NotificationListener.handleMediaUpdate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (23 pts), error handling 3 (8 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuoTouchHandler.handleHorizontalSlide (cognitive 35) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoTouchHandler.kt:285— DuoTouchHandler.handleHorizontalSlide has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 3, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AodWallpaperSettingsUIKt.AodWallpaperSettingsUI (cognitive 35) app/src/main/java/com/sameerasw/essentials/ui/features/display/AodWallpaperSettingsUI.kt:56— AodWallpaperSettingsUIKt.AodWallpaperSettingsUI has cognitive complexity 35 (threshold 15). Drivers by points: if/else 30 (32 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StatusGlanceView.calculateTargetWidth (cognitive 35) app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:814— StatusGlanceView.calculateTargetWidth has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (26 pts), match/switch 2 (5 pts), boolean chains 4 (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.
TranslationSessionSheetKt.TranslationSessionSheet (cognitive 34) app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationSessionSheet.kt:65— TranslationSessionSheetKt.TranslationSessionSheet has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (32 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpdateBottomSheetKt.UpdateBottomSheet (cognitive 34) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/UpdateBottomSheet.kt:71— UpdateBottomSheetKt.UpdateBottomSheet has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (30 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.
SoundModeTileSettingsUIKt.SoundModeTileSettingsUI (cognitive 34) app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:64— SoundModeTileSettingsUIKt.SoundModeTileSettingsUI has cognitive complexity 34 (threshold 15). Drivers by points: if/else 25 (30 pts), boolean chains 3, 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.
QSTilesSearchResultCardKt.QSTilesSearchResultCard (cognitive 34) app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:72— QSTilesSearchResultCardKt.QSTilesSearchResultCard has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 3, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HiddenGestureDetector.onTouch (cognitive 33) app/src/main/java/com/sameerasw/essentials/island/gestures/HiddenGestureDetector.kt:59— HiddenGestureDetector.onTouch has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 6, match/switch 3 (6 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ShutUpShortcutActivity.applyShutUpSettings (cognitive 33) app/src/main/java/com/sameerasw/essentials/ui/activities/ShutUpShortcutActivity.kt:112— ShutUpShortcutActivity.applyShutUpSettings has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationsPlugin.onPosted (cognitive 32) app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:356— NotificationsPlugin.onPosted has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (24 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationsPlugin.render (cognitive 32) app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:644— NotificationsPlugin.render has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 6, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
CompactInteractionKt.detectCompactGestures (cognitive 32) app/src/main/java/com/sameerasw/essentials/island/ui/CompactInteraction.kt:63— CompactInteractionKt.detectCompactGestures has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationListener.triggerAmbientGlance (cognitive 32) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:828— NotificationListener.triggerAmbientGlance has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 1 (5 pts), error handling 1 (4 pts), boolean chains 3 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FreezeGridUIKt.AppGridItem (cognitive 32) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt:536— FreezeGridUIKt.AppGridItem has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NotificationListener.handleLikeSongAction (cognitive 31) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:633— NotificationListener.handleLikeSongAction has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (5 pts), boolean chains 2, error handling 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AmbientDreamService.handleIntent (cognitive 31) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:675— AmbientDreamService.handleIntent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (28 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppToggleItemKt.AppToggleItem (cognitive 31) app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:85— AppToggleItemKt.AppToggleItem has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21 (29 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.
FeatureHelpBottomSheetKt.FeatureHelpBottomSheet (cognitive 31) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/FeatureHelpBottomSheet.kt:90— FeatureHelpBottomSheetKt.FeatureHelpBottomSheet has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24 (26 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
QuickSettingsTilesSettingsUIKt.QuickSettingsTilesSettingsUI (cognitive 31) app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:105— QuickSettingsTilesSettingsUIKt.QuickSettingsTilesSettingsUI has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (25 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.
FileSearchUtil.searchFiles (cognitive 31) app/src/main/java/com/sameerasw/essentials/utils/FileSearchUtil.kt:27— FileSearchUtil.searchFiles has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 9, error handling 1, loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
WatermarkEngine.drawOverlay (cognitive 30) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:392— WatermarkEngine.drawOverlay has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IslandController.recompute (cognitive 30) app/src/main/java/com/sameerasw/essentials/island/state/IslandController.kt:346— IslandController.recompute has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 15, if/else 14, match/switch 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AutomationItemKt.AutomationItem (cognitive 30) app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:78— AutomationItemKt.AutomationItem has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (21 pts), match/switch 3 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CalendarEventUtil.queryNextUpcomingEvent (cognitive 30) app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:71— CalendarEventUtil.queryNextUpcomingEvent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 7, error handling 1, loops 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaPlugin.evaluate (cognitive 29) app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaPlugin.kt:109— MediaPlugin.evaluate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 7 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaSurfaceBackdropKt.MediaSurface (cognitive 29) app/src/main/java/com/sameerasw/essentials/island/plugins/media/MediaSurfaceBackdrop.kt:84— MediaSurfaceBackdropKt.MediaSurface has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23 (25 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
SetupFeaturesKt.RecentSearchesSection (cognitive 29) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:1213— SetupFeaturesKt.RecentSearchesSection has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (24 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.
ScreenOffAccessibilityService.onSensorChanged (cognitive 28) app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:948— ScreenOffAccessibilityService.onSensorChanged has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 12 (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.
AppSelectionSheetsKt.AppSelectionSheet (cognitive 28) app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:68— AppSelectionSheetsKt.AppSelectionSheet has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 5, error handling 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.
GeminiParticlePillKt.GeminiParticlePill (cognitive 27) app/src/main/java/com/sameerasw/essentials/island/plugins/media/particles/GeminiParticlePill.kt:42— GeminiParticlePillKt.GeminiParticlePill has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NotificationListener.extractProgressNotification (cognitive 27) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1895— NotificationListener.extractProgressNotification has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 4 (7 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AutomationManager.refreshModules (cognitive 27) app/src/main/java/com/sameerasw/essentials/services/automation/AutomationManager.kt:106— AutomationManager.refreshModules has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, match/switch 3 (5 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.
ColorSwatchPickerKt.ColorSwatchPicker (cognitive 27) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ColorSwatchPicker.kt:85— ColorSwatchPickerKt.ColorSwatchPicker has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (23 pts), error handling 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchNotificationSettingsUIKt.WatchNotificationSettingsUI (cognitive 27) app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchNotificationSettingsUI.kt:48— WatchNotificationSettingsUIKt.WatchNotificationSettingsUI has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (23 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WatermarkPreviewAreaKt.WatermarkPreviewArea (cognitive 27) app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkPreviewArea.kt:64— WatermarkPreviewAreaKt.WatermarkPreviewArea has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21 (27 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ShellUtils.newProcess (cognitive 27) app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:175— ShellUtils.newProcess has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (25 pts), error handling 1 (2 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BatteryInfoUtil.getBasicDetails (cognitive 27) app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryInfoUtil.kt:71— BatteryInfoUtil.getBasicDetails has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChronometerRepository.onPosted (cognitive 27) app/src/main/java/com/sameerasw/essentials/utils/chronometer/ChronometerRepository.kt:128— ChronometerRepository.onPosted has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 4, match/switch 2 (4 pts), error handling 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AmbientDreamService.updateMetadata (cognitive 26) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1037— AmbientDreamService.updateMetadata has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23 (25 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.
AmbientDreamService.updateAlbumArt (cognitive 26) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1177— AmbientDreamService.updateAlbumArt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), error handling 3 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmbientGlanceHandler.updateMetadata (cognitive 26) app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:460— AmbientGlanceHandler.updateMetadata has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23 (25 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.
ConsciousGateSettingsUIKt.ConsciousGateSettingsUI (cognitive 26) app/src/main/java/com/sameerasw/essentials/ui/features/consciousgate/ConsciousGateSettingsUI.kt:60— ConsciousGateSettingsUIKt.ConsciousGateSettingsUI has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21 (26 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BatteryNotificationService.fetchBatteryData (cognitive 25) app/src/main/java/com/sameerasw/essentials/services/BatteryNotificationService.kt:181— BatteryNotificationService.fetchBatteryData has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmbientDreamService.setupContentUI (cognitive 25) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:267— AmbientDreamService.setupContentUI has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 3, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TranslationValidator.validate (cognitive 25) app/src/main/java/com/sameerasw/essentials/translation/TranslationValidator.kt:63— TranslationValidator.validate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3, 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.
BatteriesSettingsUIKt.BatteriesSettingsUI (cognitive 25) app/src/main/java/com/sameerasw/essentials/ui/features/battery/BatteriesSettingsUI.kt:54— BatteriesSettingsUIKt.BatteriesSettingsUI has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LockscreenShortcutDetector.scan (cognitive 25) app/src/main/java/com/sameerasw/essentials/utils/LockscreenShortcutDetector.kt:35— LockscreenShortcutDetector.scan has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (6 pts), boolean chains 2, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DIYViewModel.mapSuggestionToAutomation (cognitive 25) app/src/main/java/com/sameerasw/essentials/viewmodels/DIYViewModel.kt:159— DIYViewModel.mapSuggestionToAutomation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), match/switch 5 (6 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
DailyWallpaperWorker.doWork (cognitive 24) app/src/main/java/com/sameerasw/essentials/services/DailyWallpaperWorker.kt:24— DailyWallpaperWorker.doWork has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 2, error handling 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ScreenOffWidgetProvider.onReceive (cognitive 24) app/src/main/java/com/sameerasw/essentials/services/ScreenOffWidgetProvider.kt:83— ScreenOffWidgetProvider.onReceive has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (24 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.
AppFlowHandler.checkAppLock (cognitive 24) app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:269— AppFlowHandler.checkAppLock has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuoOverlayHandler.extractMediaArtworkOrAppIcon (cognitive 24) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:686— DuoOverlayHandler.extractMediaArtworkOrAppIcon has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 2 (8 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YourAndroidActivityKt.YourAndroidContent (cognitive 24) app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.kt:228— YourAndroidActivityKt.YourAndroidContent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CustomSettingsSheetKt.CustomSettingsSheet (cognitive 24) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt:93— CustomSettingsSheetKt.CustomSettingsSheet has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnderlayBlurKt.UnderlayBlur (cognitive 24) app/src/main/java/com/sameerasw/essentials/ui/navigation/UnderlayBlur.kt:44— UnderlayBlurKt.UnderlayBlur has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 5, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SystemMetricTracker.evaluateLevelCondition (cognitive 23) app/src/main/java/com/sameerasw/essentials/domain/diy/SystemMetricTracker.kt:315— SystemMetricTracker.evaluateLevelCondition has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QSTileRegistry.getAllTiles (cognitive 23) app/src/main/java/com/sameerasw/essentials/domain/registry/QSTileRegistry.kt:69— QSTileRegistry.getAllTiles has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23. 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.
PowerPressDetector.startListening (cognitive 23) app/src/main/java/com/sameerasw/essentials/input/PowerPressDetector.kt:70— PowerPressDetector.startListening has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationExpandedKt.ActionBar (cognitive 23) app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationExpanded.kt:228— NotificationExpandedKt.ActionBar has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TimeBatteryPlugin.render (cognitive 23) app/src/main/java/com/sameerasw/essentials/island/plugins/timebattery/TimeBatteryPlugin.kt:236— TimeBatteryPlugin.render has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 9, match/switch 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NotificationListener.discoverSystemChannel (cognitive 23) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:489— NotificationListener.discoverSystemChannel has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 3 (8 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.
AmbientGlanceHandler.updateAlbumArt (cognitive 23) app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:647— AmbientGlanceHandler.updateAlbumArt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), error handling 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AodWallpaperOverlayHandler.extractMediaArtwork (cognitive 23) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1221— AodWallpaperOverlayHandler.extractMediaArtwork has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 2 (8 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiSegmentedPickerKt.MultiSegmentedPicker (cognitive 23) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt:52— MultiSegmentedPickerKt.MultiSegmentedPicker has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DIYScreenKt.DIYScreen (cognitive 23) app/src/main/java/com/sameerasw/essentials/ui/features/automation/DIYScreen.kt:75— DIYScreenKt.DIYScreen has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (22 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocationTriggerSheetKt.LocationTriggerSheet (cognitive 23) app/src/main/java/com/sameerasw/essentials/ui/features/location/sheets/LocationTriggerSheet.kt:68— LocationTriggerSheetKt.LocationTriggerSheet has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 7, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
KaomojiPickerKt.KaomojiPicker (cognitive 23) app/src/main/java/com/sameerasw/essentials/ui/ime/KaomojiPicker.kt:68— KaomojiPickerKt.KaomojiPicker has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HapticFeedbackUtilsKt.performHapticFeedback (cognitive 23) app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:26— HapticFeedbackUtilsKt.performHapticFeedback has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
HapticUtil.performCustomHaptic (cognitive 23) app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt:354— HapticUtil.performCustomHaptic has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AppUpdatesViewModel.searchRepo (cognitive 23) app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:145— AppUpdatesViewModel.searchRepo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppUpdatesViewModel.checkForUpdates (cognitive 23) app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt:509— AppUpdatesViewModel.checkForUpdates has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
clean_release_notes.clean_release_notes (cognitive 23) .github/scripts/clean_release_notes.py:14— clean_release_notes.clean_release_notes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IslandCoordinator.applyConfig (cognitive 22) app/src/main/java/com/sameerasw/essentials/island/service/IslandCoordinator.kt:795— IslandCoordinator.applyConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, boolean chains 7, 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.
IslandCoordinator.fitsCompactWidth (cognitive 22) app/src/main/java/com/sameerasw/essentials/island/service/IslandCoordinator.kt:987— IslandCoordinator.fitsCompactWidth has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DeviceInfoSyncManager.performSync (cognitive 22) app/src/main/java/com/sameerasw/essentials/services/DeviceInfoSyncManager.kt:196— DeviceInfoSyncManager.performSync has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 2, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WatchNotificationSyncManager.onNotificationPosted (cognitive 22) app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:107— WatchNotificationSyncManager.onNotificationPosted has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 8, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AodWallpaperOverlayHandler.checkAndApplyMediaState (cognitive 22) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:159— AodWallpaperOverlayHandler.checkAndApplyMediaState has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 8 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FaceUnlockBrightnessHandler.isMainLockscreenVisible (cognitive 22) app/src/main/java/com/sameerasw/essentials/services/handlers/FaceUnlockBrightnessHandler.kt:310— FaceUnlockBrightnessHandler.isMainLockscreenVisible has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 pts), boolean chains 2, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QsTileRegistry.getTileIcon (cognitive 22) app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:327— QsTileRegistry.getTileIcon has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1, error handling 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LockscreenShortcutsSettingsUIKt.LockscreenShortcutsSettingsUI (cognitive 22) app/src/main/java/com/sameerasw/essentials/ui/features/system/LockscreenShortcutsSettingsUI.kt:55— LockscreenShortcutsSettingsUIKt.LockscreenShortcutsSettingsUI has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, error handling 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShellUtils.runCommandBlocking (cognitive 22) app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:90— ShellUtils.runCommandBlocking has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (22 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WatermarkEngine.drawFrameContent (cognitive 21) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:666— WatermarkEngine.drawFrameContent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StatusGlanceHandler.queryUpcomingCalendarEvent (cognitive 21) app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:516— StatusGlanceHandler.queryUpcomingCalendarEvent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, error handling 1, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimpleMarkdownKt.RenderImage (cognitive 21) app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:467— SimpleMarkdownKt.RenderImage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TrackedRepoCardKt.TrackedRepoCard (cognitive 21) app/src/main/java/com/sameerasw/essentials/ui/core/cards/TrackedRepoCard.kt:67— TrackedRepoCardKt.TrackedRepoCard has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (18 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SegmentedPickerKt.SegmentedPicker (cognitive 21) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/SegmentedPicker.kt:57— SegmentedPickerKt.SegmentedPicker has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatermarkScreenKt.WatermarkScreen (cognitive 21) app/src/main/java/com/sameerasw/essentials/ui/features/watermark/WatermarkScreen.kt:60— WatermarkScreenKt.WatermarkScreen has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppUtil.isAndroidAutoRunning (cognitive 21) app/src/main/java/com/sameerasw/essentials/utils/AppUtil.kt:394— AppUtil.isAndroidAutoRunning has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CallNotificationParser.parse (cognitive 21) app/src/main/java/com/sameerasw/essentials/utils/call/CallNotificationParser.kt:70— CallNotificationParser.parse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 4, error handling 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ContributorsRepository.getContributors (cognitive 20) app/src/main/java/com/sameerasw/essentials/data/repository/ContributorsRepository.kt:25— ContributorsRepository.getContributors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 4 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VolumeLongPressDetector.handleButton (cognitive 20) app/src/main/java/com/sameerasw/essentials/input/VolumeLongPressDetector.kt:99— VolumeLongPressDetector.handleButton has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (20 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PoissonDiskKt.generatePoissonTile (cognitive 20) app/src/main/java/com/sameerasw/essentials/island/plugins/media/particles/PoissonDisk.kt:30— PoissonDiskKt.generatePoissonTile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteExpandedKt.RemoteExpanded (cognitive 20) app/src/main/java/com/sameerasw/essentials/island/remote/RemoteExpanded.kt:44— RemoteExpandedKt.RemoteExpanded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, 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.
IslandComponentsKt.BatteryGlyph (cognitive 20) app/src/main/java/com/sameerasw/essentials/island/ui/components/IslandComponents.kt:337— IslandComponentsKt.BatteryGlyph has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
AppFlowHandler.restoreShutUpSettings (cognitive 20) app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:1021— AppFlowHandler.restoreShutUpSettings has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, error handling 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuoOverlayHandler.isFastCharging (cognitive 20) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:190— DuoOverlayHandler.isFastCharging has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 6, boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FlashlightHandler.pulseFlashlightForNotificationWithCheck (cognitive 20) app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:472— FlashlightHandler.pulseFlashlightForNotificationWithCheck has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QsTileRegistry.getTileSubtitle (cognitive 20) app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:268— QsTileRegistry.getTileSubtitle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BubbleWebActivityKt.BubbleWebScreen (cognitive 20) app/src/main/java/com/sameerasw/essentials/ui/activities/BubbleWebActivity.kt:159— BubbleWebActivityKt.BubbleWebScreen has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 2, error handling 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppLockSettingsUIKt.AppLockSettingsUI (cognitive 20) app/src/main/java/com/sameerasw/essentials/ui/features/security/AppLockSettingsUI.kt:49— AppLockSettingsUIKt.AppLockSettingsUI has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CameraFlipButton.click (cognitive 20) app/src/main/java/com/sameerasw/essentials/utils/CameraFlipButton.kt:74— CameraFlipButton.click has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (6 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SettingsRepository.syncSystemSettingsWithSaved (cognitive 19) app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:3208— SettingsRepository.syncSystemSettingsWithSaved has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HilightFrames.patternFrame (cognitive 19) app/src/main/java/com/sameerasw/essentials/domain/model/HilightEffect.kt:129— HilightFrames.patternFrame has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BriefPluginKt.BriefExpanded (cognitive 19) app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:210— BriefPluginKt.BriefExpanded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ProgressPluginKt.ProgressPill (cognitive 19) app/src/main/java/com/sameerasw/essentials/island/plugins/progress/ProgressPlugin.kt:246— ProgressPluginKt.ProgressPill has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NotificationListener.discoverMapsChannel (cognitive 19) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:426— NotificationListener.discoverMapsChannel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AodWallpaperOverlayHandler.showOverlay (cognitive 19) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:940— AodWallpaperOverlayHandler.showOverlay has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ButtonRemapHandler.handlePowerGesture (cognitive 19) app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt:221— ButtonRemapHandler.handlePowerGesture has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SnippetExpansionHandler.onTextChanged (cognitive 19) app/src/main/java/com/sameerasw/essentials/services/handlers/SnippetExpansionHandler.kt:34— SnippetExpansionHandler.onTextChanged has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
QsTileActionRouter.onReceive (cognitive 19) app/src/main/java/com/sameerasw/essentials/services/receivers/QsTileActionRouter.kt:34— QsTileActionRouter.onReceive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlashlightIntensityActivityKt.FlashlightIntensityOverlay (cognitive 19) app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt:127— FlashlightIntensityActivityKt.FlashlightIntensityOverlay has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1, error handling 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FeatureHelpMediaViewerKt.FeatureHelpMediaViewer (cognitive 19) app/src/main/java/com/sameerasw/essentials/ui/core/media/FeatureHelpMediaViewer.kt:89— FeatureHelpMediaViewerKt.FeatureHelpMediaViewer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BackGestureSettingsUIKt.BackGestureSettingsUI (cognitive 19) app/src/main/java/com/sameerasw/essentials/ui/features/system/BackGestureSettingsUI.kt:85— BackGestureSettingsUIKt.BackGestureSettingsUI has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WatchWirelessDebuggingSettingsUIKt.WatchWirelessDebuggingSettingsUI (cognitive 19) app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchWirelessDebuggingSettingsUI.kt:53— WatchWirelessDebuggingSettingsUIKt.WatchWirelessDebuggingSettingsUI has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 2, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppNavigationViewModel.navigate (cognitive 19) app/src/main/java/com/sameerasw/essentials/ui/navigation/AppRoute.kt:54— AppNavigationViewModel.navigate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainViewModel.checkForUpdates (cognitive 19) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:3733— MainViewModel.checkForUpdates has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationsPlugin.onTimeout (cognitive 18) app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:452— NotificationsPlugin.onTimeout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationsPlugin.senderAndMessage (cognitive 18) app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt:1078— NotificationsPlugin.senderAndMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OtpExtractor.extract (cognitive 18) app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/OtpExtractor.kt:42— OtpExtractor.extract has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AodWallpaperOverlayHandler.hideOverlay (cognitive 18) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1421— AodWallpaperOverlayHandler.hideOverlay has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppFlowHandler.onPackageChanged (cognitive 18) app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt:175— AppFlowHandler.onPackageChanged has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusGlanceCalendarOptionsBottomSheetKt.StatusGlanceCalendarOptionsBottomSheet (cognitive 18) app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/StatusGlanceCalendarOptionsBottomSheet.kt:51— StatusGlanceCalendarOptionsBottomSheetKt.StatusGlanceCalendarOptionsBottomSheet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LockScreenClockSettingsUIKt.LockScreenClockSettingsUI (cognitive 18) app/src/main/java/com/sameerasw/essentials/ui/features/system/LockScreenClockSettingsUI.kt:65— LockScreenClockSettingsUIKt.LockScreenClockSettingsUI has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 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.
KeyboardInputViewKt.KeyButton (cognitive 18) app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:243— KeyboardInputViewKt.KeyButton has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProgressiveBlurModifierKt.progressiveBlur (cognitive 18) app/src/main/java/com/sameerasw/essentials/ui/modifiers/ProgressiveBlurModifier.kt:37— ProgressiveBlurModifierKt.progressiveBlur has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 3 (8 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusGlanceView.onDraw (cognitive 18) app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:1254— StatusGlanceView.onDraw has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ShizukuUtils.toggleShizuku (cognitive 18) app/src/main/java/com/sameerasw/essentials/utils/security/ShizukuUtils.kt:199— ShizukuUtils.toggleShizuku has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseEssentialsAppFunctionService.createAutomation (cognitive 17) app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt:403— BaseEssentialsAppFunctionService.createAutomation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, match/switch 5 (8 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SystemMetricTracker.baselineRecord (cognitive 17) app/src/main/java/com/sameerasw/essentials/domain/diy/SystemMetricTracker.kt:208— SystemMetricTracker.baselineRecord has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (17 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenAIAutomationService.suggestAutomation (cognitive 17) app/src/main/java/com/sameerasw/essentials/domain/genai/GenAIAutomationService.kt:39— GenAIAutomationService.suggestAutomation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 2 (3 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CaffeinatePlugin.render (cognitive 17) app/src/main/java/com/sameerasw/essentials/island/plugins/caffeinate/CaffeinatePlugin.kt:107— CaffeinatePlugin.render has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 5, match/switch 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.
StatusGlanceHandler.extractMediaArtwork (cognitive 17) app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:925— StatusGlanceHandler.extractMediaArtwork has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatteriesWidgetReceiver.onReceive (cognitive 17) app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidgetReceiver.kt:25— BatteriesWidgetReceiver.onReceive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 3 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StackWidgetProvider.build (cognitive 17) app/src/main/java/com/sameerasw/essentials/services/widgets/StackWidgetProvider.kt:144— StackWidgetProvider.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 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.
TranslationManager.findKey (cognitive 17) app/src/main/java/com/sameerasw/essentials/translation/TranslationManager.kt:72— TranslationManager.findKey has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppPickerAdapterKt.AppPickerItem (cognitive 17) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/AppPickerAdapter.kt:64— AppPickerAdapterKt.AppPickerItem has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimpleMarkdownKt.parseMarkdownToBlocks (cognitive 17) app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:158— SimpleMarkdownKt.parseMarkdownToBlocks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScreenLockedSecuritySettingsUIKt.ScreenLockedSecuritySettingsUI (cognitive 17) app/src/main/java/com/sameerasw/essentials/ui/features/security/ScreenLockedSecuritySettingsUI.kt:39— ScreenLockedSecuritySettingsUIKt.ScreenLockedSecuritySettingsUI has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TimerPlugin.render (cognitive 16) app/src/main/java/com/sameerasw/essentials/island/plugins/timer/TimerPlugin.kt:145— TimerPlugin.render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExpandedHostKt.edgeAwareScroll (cognitive 16) app/src/main/java/com/sameerasw/essentials/island/ui/ExpandedHost.kt:73— ExpandedHostKt.edgeAwareScroll has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 7, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationListener.extractBitmap (cognitive 16) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:554— NotificationListener.extractBitmap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuoOverlayHandler.registerBatteryReceiver (cognitive 16) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:1256— DuoOverlayHandler.registerBatteryReceiver has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuoOverlayHandler.unregisterSignalListeners (cognitive 16) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:1352— DuoOverlayHandler.unregisterSignalListeners has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScreenOffAccessibilityService.onKeyEvent (cognitive 16) app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt:1038— ScreenOffAccessibilityService.onKeyEvent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PixelSearchResultsActivityKt.loadContacts (cognitive 16) app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchResultsActivity.kt:1563— PixelSearchResultsActivityKt.loadContacts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppColorSelectionSheetKt.AppColorSelectionSheet (cognitive 16) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:76— AppColorSelectionSheetKt.AppColorSelectionSheet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutomationItemKt.automationSummary (cognitive 16) app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:421— AutomationItemKt.automationSummary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 3 (5 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IslandInteractionsSettingsUIKt.IslandInteractionsSettingsUI (cognitive 16) app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandInteractionsSettingsUI.kt:109— IslandInteractionsSettingsUIKt.IslandInteractionsSettingsUI has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
RefreshRateSettingsUIKt.RefreshRateSettingsUI (cognitive 16) app/src/main/java/com/sameerasw/essentials/ui/features/display/RefreshRateSettingsUI.kt:44— RefreshRateSettingsUIKt.RefreshRateSettingsUI has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ScreenshotsSettingsUIKt.ScreenshotsSettingsUI (cognitive 16) app/src/main/java/com/sameerasw/essentials/ui/features/security/ScreenshotsSettingsUI.kt:49— ScreenshotsSettingsUIKt.ScreenshotsSettingsUI has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, 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.
BackGestureSettingsUIKt.BackGesturePermissionsSheet (cognitive 16) app/src/main/java/com/sameerasw/essentials/ui/features/system/BackGestureSettingsUI.kt:518— BackGestureSettingsUIKt.BackGesturePermissionsSheet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EmojiPickerKt.EmojiPicker (cognitive 16) app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiPicker.kt:66— EmojiPickerKt.EmojiPicker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
PartReader.loadDump (cognitive 16) app/src/main/java/com/sameerasw/essentials/utils/BluetoothBatteryUtils.kt:39— PartReader.loadDump has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CalendarEventUtil.queryBriefEvents (cognitive 16) app/src/main/java/com/sameerasw/essentials/utils/CalendarEventUtil.kt:162— CalendarEventUtil.queryBriefEvents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlashlightUtil.fadeFlashlight (cognitive 16) app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt:127— FlashlightUtil.fadeFlashlight has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Near-duplicate member pair (69 shared lines) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:63— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:63-207 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt:60-216 — These two members are variants of one another: 69 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 (45 shared lines) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:675— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:675-800 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:277-458 — These two members are variants of one another: 45 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 (32 shared lines) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:429— app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:429-487 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:493-552 — These two members are variants of one another: 32 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (49 corresponding lines) · ×1
Edited copy of a member (49 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:175— app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:175-1624 | app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:106-271 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1221— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1221-1261 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:686-726 — 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· 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/sameerasw/essentials/ui/core/sheets/TimeSelectionSheet.kt:62— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/TimeSelectionSheet.kt:62-262 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:60-218 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/WaitSettingsSheet.kt:43-126 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/ChargingModeSettingsSheet.kt:55-178 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/OverlayControlSettingsSheet.kt:57-197 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt:60-324 | app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/DimWallpaperSettingsSheet.kt:57-244 — 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 (121 corresponding lines) · ×1
Edited copy of a member (121 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1037— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1037-1161 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:460-580 — These two members are one piece of code written twice and then edited apart: 121 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 147+ corresponding lines) · ×1
Edited copies of one member (3 members, 147+ corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchAppActionSheet.kt:53— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchAppActionSheet.kt:53-201 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchContactActionSheet.kt:56-202 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchFileActionSheet.kt:58-210 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 147 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 (127 corresponding lines) · ×1
Edited copy of a member (127 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/components/HelpAndGuides.kt:182— app/src/main/java/com/sameerasw/essentials/ui/components/HelpAndGuides.kt:182-308 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/LicensesBottomSheet.kt:202-328 — These two members are one piece of code written twice and then edited apart: 127 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (112 corresponding lines) · ×1
Edited copy of a member (112 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:236— app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:236-347 | app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt:1062-1176 — These two members are one piece of code written twice and then edited apart: 112 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (92 corresponding lines) · ×1
Edited copy of a member (92 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:111— app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:111-202 | app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:207-300 — These two members are one piece of code written twice and then edited apart: 92 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (107 corresponding lines) · ×1
Edited copy of a member (107 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt:62— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt:62-168 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/SegmentedPicker.kt:70-184 — These two members are one piece of code written twice and then edited apart: 107 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (59 corresponding lines) · ×1
Edited copy of a member (59 corresponding lines) app/src/main/java/com/sameerasw/essentials/data/repository/HelpMediaRepository.kt:35— app/src/main/java/com/sameerasw/essentials/data/repository/HelpMediaRepository.kt:35-93 | app/src/main/java/com/sameerasw/essentials/data/repository/ProjectDetailsRepository.kt:26-87 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (63 corresponding lines) · ×1
Edited copy of a member (63 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandCallOptionsBottomSheet.kt:31— app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandCallOptionsBottomSheet.kt:31-109 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandLiveUpdatesOptionsBottomSheet.kt:32-94 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt:31— app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt:31-102 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4913-4972 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (52 corresponding lines) · ×1
Edited copy of a member (52 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:585— app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:585-636 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:786-837 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (80 corresponding lines) · ×1
Edited copy of a member (80 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt:44— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt:44-123 | app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationIconPicker.kt:43-123 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (83 corresponding lines) · ×1
Edited copy of a member (83 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ImportConfigConfirmationSheet.kt:40— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ImportConfigConfirmationSheet.kt:40-125 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PreReleaseConfirmationSheet.kt:41-123 — These two members are one piece of code written twice and then edited apart: 83 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (62 corresponding lines) · ×1
Edited copy of a member (62 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandBorderOutlineOptionsBottomSheet.kt:35— app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandBorderOutlineOptionsBottomSheet.kt:35-96 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandGlowOptionsBottomSheet.kt:37-118 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (68 corresponding lines) · ×1
Edited copy of a member (68 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1180— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1180-1255 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:647-714 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×1
Edited copy of a member (45 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryRingDrawer.kt:56— app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryRingDrawer.kt:56-107 | app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryRingDrawer.kt:116-160 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (58 corresponding lines) · ×1
Edited copy of a member (58 corresponding lines) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:6750— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:6750-6807 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:7663-7720 — 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 (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:557— app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:557-612 | app/src/main/java/com/sameerasw/essentials/ui/components/AppsComponents.kt:95-152 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperRepository.kt:29— app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperRepository.kt:29-68 | app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperStagingRepository.kt:30-82 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:1610— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:1610-1660 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ButtonRemapSettingsUI.kt:467-518 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 48+ corresponding lines) · ×1
Edited copies of one member (4 members, 48+ corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:42— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:42-89 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:1285-1334 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:1342-1391 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/NotificationLightingSystemModePicker.kt:42-90 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 48 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 (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt:47— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt:47-89 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingColorModePicker.kt:44-79 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1404— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1404-1444 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:585-625 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×1
Edited copy of a member (32 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/overlay/DashOverlay.kt:66— app/src/main/java/com/sameerasw/essentials/utils/overlay/DashOverlay.kt:66-97 | app/src/main/java/com/sameerasw/essentials/utils/overlay/RippleOverlay.kt:55-88 — 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 (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:95— app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:95-131 | app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt:180-228 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) app/src/main/java/com/sameerasw/essentials/viewmodels/GitHubAuthViewModel.kt:61— app/src/main/java/com/sameerasw/essentials/viewmodels/GitHubAuthViewModel.kt:61-103 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:3379-3430 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidgetReceiver.kt:24— app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidgetReceiver.kt:24-53 | app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidgetReceiver.kt:24-59 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 38+ corresponding lines) · ×1
Edited copies of one member (3 members, 38+ corresponding lines) app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/DuoTimeOptionsBottomSheet.kt:36— app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/DuoTimeOptionsBottomSheet.kt:36-76 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandBriefOptionsBottomSheet.kt:39-83 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandSoundModeOptionsBottomSheet.kt:36-73 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited 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/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1094— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1094-1123 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:554-583 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:839-863 — 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 copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/CallControlUtil.kt:26— app/src/main/java/com/sameerasw/essentials/utils/CallControlUtil.kt:26-48 | app/src/main/java/com/sameerasw/essentials/utils/CallControlUtil.kt:50-72 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4450— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4450-4474 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4487-4513 — 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, 17+ corresponding lines) · ×1
Edited copies of one member (4 members, 17+ corresponding lines) app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4139— app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4139-4157 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4281-4297 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4302-4318 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:4565-4586 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) app/src/main/java/com/sameerasw/essentials/island/service/IslandWindowHost.kt:145— app/src/main/java/com/sameerasw/essentials/island/service/IslandWindowHost.kt:145-161 | app/src/main/java/com/sameerasw/essentials/services/handlers/AppVolumeOverlayHandler.kt:269-284 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:322-345 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:890— app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:890-909 | app/src/main/java/com/sameerasw/essentials/utils/QrCodeGenerator.kt:112-127 | app/src/main/java/com/sameerasw/essentials/utils/StatusGlanceView.kt:510-521 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) app/src/main/java/com/sameerasw/essentials/services/automation/modules/DisplayModule.kt:95— app/src/main/java/com/sameerasw/essentials/services/automation/modules/DisplayModule.kt:95-111 | app/src/main/java/com/sameerasw/essentials/services/automation/modules/PowerModule.kt:240-256 | app/src/main/java/com/sameerasw/essentials/services/automation/modules/PowerModule.kt:261-277 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) app/src/main/java/com/sameerasw/essentials/ime/UndoRedoManager.kt:79— app/src/main/java/com/sameerasw/essentials/ime/UndoRedoManager.kt:79-94 | app/src/main/java/com/sameerasw/essentials/ime/UndoRedoManager.kt:96-111 — 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 (4 members, 12+ corresponding lines) · ×1
Edited copies of one member (4 members, 12+ corresponding lines) app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1448— app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1448-1459 | app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1744-1759 | app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1840-1855 | app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1895-1910 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt:273— app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt:273-293 | app/src/main/java/com/sameerasw/essentials/utils/overlay/DashOverlay.kt:40-58 | app/src/main/java/com/sameerasw/essentials/utils/overlay/RippleOverlay.kt:31-49 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 12+ corresponding lines) · ×1
Edited copies of one member (7 members, 12+ corresponding lines) app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1279— app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1279-1290 | app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1411-1422 | app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1871-1882 | app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1926-1942 | app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:2228-2239 | app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:2255-2266 | app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:4801-4812 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×1
Edited copy of a member (4 corresponding lines) app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:4580— app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:4580-4583 | app/src/main/java/com/sameerasw/essentials/island/remote/ProviderTrustStore.kt:55-58 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×1
Edited copies of one member (3 members, 9+ corresponding lines) app/src/main/java/com/sameerasw/essentials/domain/controller/CaffeinateController.kt:191— app/src/main/java/com/sameerasw/essentials/domain/controller/CaffeinateController.kt:191-199 | app/src/main/java/com/sameerasw/essentials/services/tiles/CaffeinateTileService.kt:90-98 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:8749-8758 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×1
Edited copies of one member (3 members, 5+ corresponding lines) app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1490— app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1490-1494 | app/src/main/java/com/sameerasw/essentials/utils/AppColorUtil.kt:52-58 | app/src/main/java/com/sameerasw/essentials/utils/BluetoothDeviceIcons.kt:178-182 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) app/src/main/java/com/sameerasw/essentials/services/tiles/AlwaysOnDisplayTileService.kt:32— app/src/main/java/com/sameerasw/essentials/services/tiles/AlwaysOnDisplayTileService.kt:32-34 | app/src/main/java/com/sameerasw/essentials/services/tiles/NfcTileService.kt:73-75 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (156–157 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:992— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:992-1148 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:749-904 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:992` 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 (81–82 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:415— app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:415-495 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:548-629 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 345 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:415` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (78 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:270— app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:270-347 | app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt:1099-1176 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt:270` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (73 lines × 2) app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1040— app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:1040-1112 | app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt:464-536 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (62–65 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:249— app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:249-310 | app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:313-377 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:249` 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: `Icon` names `android.graphics.drawable.Icon` in one and `androidx.compose.material3.Icon` 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 (61 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1149— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1149-1209 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:907-967 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1149` 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–55 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1356— app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1356-1405 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1492-1546 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1743-1792 — 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/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1356` 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 (52 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:403— app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:403-454 | app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:520-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/activities/TravelCompassActivity.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 after the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:572` calls `isNotEmpty` and `app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt:455` 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 (51 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt:167— app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt:167-217 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt:281-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt:167` 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 (48 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:526— app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt:526-573 | app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt:159-206 — 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 (46 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiPicker.kt:97— app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiPicker.kt:97-142 | app/src/main/java/com/sameerasw/essentials/ui/ime/KaomojiPicker.kt:101-146 — 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/sameerasw/essentials/ui/ime/EmojiPicker.kt:97` 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/sameerasw/essentials/ui/ime/KaomojiPicker.kt:100` calls `animateScrollToItem` and `app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiPicker.kt:96` 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 (44–45 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1311— app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1311-1354 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1446-1490 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1698-1741 — 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/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1311` it does not close everything it opens, so those 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 (43–44 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:193— app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:193-235 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:266-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/core/cards/AppToggleItem.kt:193` it begins part-way through the construct above it, so those 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 (43 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:904— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:904-946 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:662-704 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:206-248 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:904` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:948` calls `Spacer`, `height` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:705` 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 (38–39 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:138— app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:138-176 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/ChargingModeSettingsSheet.kt:99-136 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/ChargingModeSettingsSheet.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:138` 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 (38 lines × 2) app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt:208— app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt:208-245 | app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt:272-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/services/widgets/FavoritesWidget.kt:208` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (37 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:115— app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:115-151 | app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt:105-141 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:115` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (36 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:130— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:130-165 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt:127-162 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:130` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (34–35 lines × 2) app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:143— app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:143-177 | app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:241-274 — both copies are in the same file, so extract the 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 (34 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:366— app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:366-399 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:495-528 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 345 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:366` 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 × 3) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:857— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:857-889 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:615-647 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:159-191 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:857` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt:210— app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt:210-242 | app/src/main/java/com/sameerasw/essentials/ui/activities/SmartPixelsIntensityActivity.kt:95-127 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt:210` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31–32 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:709— app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:709-739 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:344-375 — 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/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:709` it does not close everything it opens, so those exact lines 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 × 3) app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt:154— app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt:154-184 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt:268-298 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt:390-420 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (30 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureDropdownRow.kt:62— app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureDropdownRow.kt:62-91 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureToggleRow.kt:47-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureDropdownRow.kt:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureDropdownRow.kt:60` calls `mutableStateOf` and `app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureToggleRow.kt:46` 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 (28–30 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:88— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:88-117 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt:108-135 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (27–29 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/HelpAndGuides.kt:196— app/src/main/java/com/sameerasw/essentials/ui/components/HelpAndGuides.kt:196-222 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/LicensesBottomSheet.kt:218-246 — 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/sameerasw/essentials/ui/components/HelpAndGuides.kt:196` 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 `section` to `InstructionSection` in one and `LicenseSection` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (26–28 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:830— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:830-855 | app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:909-936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:830` it does not close everything it opens, so those 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 (25–27 lines × 3) app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1223— app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:1223-1249 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:687-711 | app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.kt:926-950 — 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.
Duplicated block (26 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:207— app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:207-232 | app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:265-290 | app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:323-348 — 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/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:207` 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–26 lines × 2) app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:396— app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:396-421 | app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt:379-400 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt` and `app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt:396` it does not close everything it opens, so those 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 (24–26 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:695— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:695-720 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:968-991 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:695` 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 (25 lines × 12) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt:479— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt:479-503 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/TimeSelectionSheet.kt:204-228 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:178-202 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/NotificationTriggerSheet.kt:114-138 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/SendNotificationSettingsSheet.kt:100-124 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/WaitSettingsSheet.kt:86-110 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/ChargingModeSettingsSheet.kt:138-162 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/OverlayControlSettingsSheet.kt:157-181 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt:275-299 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/sheets/NotificationLightingActionSheet.kt:170-194 | app/src/main/java/com/sameerasw/essentials/ui/features/network/sheets/WifiNetworkSelectionSheet.kt:184-208 | app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/DimWallpaperSettingsSheet.kt:204-228 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt:479` it begins part-way through the construct above it, so those exact lines 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 × 2) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:667— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:667-693 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:941-966 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:667` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (21–25 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:511— app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:511-531 | app/src/main/java/com/sameerasw/essentials/ui/core/media/FeatureHelpMediaViewer.kt:314-338 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:511` it does not close everything it opens, so those 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/sameerasw/essentials/ui/core/media/FeatureHelpMediaViewer.kt:339` calls `snapTo` and `app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt:532` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (23–25 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:119— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:119-143 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt:137-159 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt:166— app/src/main/java/com/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt:166-189 | app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:84-107 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:85-108 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt:190` calls `add` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:109` 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 (23–24 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:397— app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:397-419 | app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:466-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/components/linkActions/FloatingWithFragment.kt:397` 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 (22–23 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FrozenAppsSearchResultCard.kt:126— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FrozenAppsSearchResultCard.kt:126-147 | app/src/main/java/com/sameerasw/essentials/ui/features/permissions/PermissionsSearchResultCard.kt:97-119 | app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:167-189 — 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/sameerasw/essentials/ui/features/freeze/FrozenAppsSearchResultCard.kt:126` 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: `Icon` names `android.graphics.drawable.Icon` in one and `androidx.compose.material3.Icon` 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 (21–23 lines × 2) app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1763— app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1763-1785 | app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1800-1820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/services/NotificationListener.kt:1763` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchAppActionSheet.kt:54— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchAppActionSheet.kt:54-75 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchContactActionSheet.kt:57-78 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PixelSearchFileActionSheet.kt:59-80 — 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/sameerasw/essentials/ui/core/sheets/PixelSearchAppActionSheet.kt:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–22 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:481— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:481-502 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:127-145 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:481` it begins part-way through the construct above it, so those exact lines 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/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:340— app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:340-361 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:434-454 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 345 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:340` it begins part-way through the construct above it, so those exact lines 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–22 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt:415— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt:415-436 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FrozenAppsSearchResultCard.kt:162-179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt:415` it does not close everything it opens, so those 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 (20–21 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt:62— app/src/main/java/com/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt:62-82 | app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:169-188 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:163-182 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–21 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:536— app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:536-556 | app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:1136-1153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/composables/WelcomeScreen.kt:536` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–21 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:274— app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:274-294 | app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:451-469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:274` it does not close everything it opens, so those exact lines 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 × 4) app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:546— app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:546-565 | app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:723-742 | app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:918-937 | app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt:1143-1162 — 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/sameerasw/essentials/ui/composables/WelcomeScreen.kt:546` 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 × 5) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:60— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:60-78 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:1307-1325 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:1364-1382 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.kt:75-93 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/NotificationLightingSystemModePicker.kt:61-79 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:60` it begins part-way through the construct above it, so those 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 =` in one and `Modifier = 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:59` calls `RoundedCornerShape` and `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt:1306` 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–19 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:395— app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:395-412 | app/src/main/java/com/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt:166-184 | app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:84-102 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:85-103 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt:395` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1410— app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1410-1427 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1553-1571 | app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1797-1814 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt:1410` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:749— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:749-766 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AppColorSelectionSheet.kt:194-211 | app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:233-250 — 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/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:749` it begins part-way through the construct above it, so those 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/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt:232` calls `padding` and `app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:748` 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–18 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:224— app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:224-241 | app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:281-298 | app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:457-473 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QSTilesSearchResultCard.kt:221` calls `when` and `app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt:279` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17–18 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:329— app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:329-346 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt:352-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/sameerasw/essentials/ui/features/automation/components/AutomationItem.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–18 lines × 2) app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:594— app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:594-611 | app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:666-680 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:594` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:138— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:138-154 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt:135-151 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/RestoreModePicker.kt:83-99 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:138` it begins part-way through the construct above it, so those 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/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt:155` calls `performUIHaptic` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/RestoreModePicker.kt:100` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–17 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:898— app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:898-913 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:444-459 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:576-592 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:898` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15–16 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1158— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1158-1172 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:916-930 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:462-476 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:595-610 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1158` 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–16 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:990— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:990-1003 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:383-398 — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:990` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 16) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ActivityIconSheet.kt:181— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ActivityIconSheet.kt:181-195 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt:478-492 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/TimeSelectionSheet.kt:203-217 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetModeSettingsSheet.kt:177-191 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SetVolumeSettingsSheet.kt:148-162 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:177-191 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/NotificationTriggerSheet.kt:113-127 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/SendNotificationSettingsSheet.kt:99-113 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/WaitSettingsSheet.kt:85-99 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/ChargingModeSettingsSheet.kt:137-151 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/OverlayControlSettingsSheet.kt:156-170 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt:274-288 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/sheets/NotificationLightingActionSheet.kt:169-183 | app/src/main/java/com/sameerasw/essentials/ui/features/location/sheets/LocationTriggerSheet.kt:276-289 | app/src/main/java/com/sameerasw/essentials/ui/features/network/sheets/WifiNetworkSelectionSheet.kt:183-197 | app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/DimWallpaperSettingsSheet.kt:203-217 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CustomSettingsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/core/sheets/ActivityIconSheet.kt:181` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1104— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1104-1118 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:860-874 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:406-420 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1104` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13–15 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:134— app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:134-146 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:138-152 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:134` it begins part-way through the construct above it, so those exact lines 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 × 7) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/TimeSelectionSheet.kt:249— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/TimeSelectionSheet.kt:249-262 | app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt:205-218 | app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/WaitSettingsSheet.kt:113-126 | app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/ChargingModeSettingsSheet.kt:165-178 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/OverlayControlSettingsSheet.kt:184-197 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt:311-324 | app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/DimWallpaperSettingsSheet.kt:231-244 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/TimeSelectionSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/core/sheets/TimeSelectionSheet.kt:249` 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–14 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt:513— app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt:513-525 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt:103-116 | app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt:123-135 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt:513` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–14 lines × 2) app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:623— app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:623-636 | app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:708-718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt:623` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:103— app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:103-115 | app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:205-217 | app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:263-275 | app/src/main/java/com/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:321-333 — 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/sameerasw/essentials/ui/modifiers/ScrollMotionBlurModifier.kt:103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 3) app/src/main/java/com/sameerasw/essentials/services/CalendarSyncManager.kt:138— app/src/main/java/com/sameerasw/essentials/services/CalendarSyncManager.kt:138-148 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:6772-6784 | app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:7685-7697 — 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/sameerasw/essentials/services/CalendarSyncManager.kt:138` it begins part-way through the construct above it, so those 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/sameerasw/essentials/services/CalendarSyncManager.kt:149` calls `getColumnIndex` and `app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:6786` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–13 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:122— app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:122-132 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:124-136 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 6) app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AodCompatibilityInfoBottomSheet.kt:32— app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AodCompatibilityInfoBottomSheet.kt:32-43 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/CameraFlipInfoBottomSheet.kt:26-37 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/HideStatusBarInfoBottomSheet.kt:32-43 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PreferStillIslandInfoBottomSheet.kt:23-34 | app/src/main/java/com/sameerasw/essentials/ui/core/sheets/StatusBarAwareWidthInfoBottomSheet.kt:23-34 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/IslandDevicesBatteryBottomSheet.kt:47-59 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AodCompatibilityInfoBottomSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/HideStatusBarInfoBottomSheet.kt` as WHOLE FILES: 89% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AodCompatibilityInfoBottomSheet.kt:32` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:117— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:117-126 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:112-121 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:77-86 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:107-118 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:120` calls `mutableStateOf` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:128` 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 × 4) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1175— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1175-1186 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:933-944 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:479-490 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:613-624 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:1175` 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–12 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/components/FavoriteCarousel.kt:198— app/src/main/java/com/sameerasw/essentials/ui/components/FavoriteCarousel.kt:198-207 | app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureCard.kt:125-136 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 5) app/src/main/java/com/sameerasw/essentials/ui/features/consciousgate/ConsciousGateSettingsUI.kt:150— app/src/main/java/com/sameerasw/essentials/ui/features/consciousgate/ConsciousGateSettingsUI.kt:150-160 | app/src/main/java/com/sameerasw/essentials/ui/features/security/AppLockSettingsUI.kt:86-96 | app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:227-237 | app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:362-372 | app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:663-673 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/consciousgate/ConsciousGateSettingsUI.kt:150` 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/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:240` calls `stringResource` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt:375` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:614— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:614-624 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:788-797 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:824-834 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:614` it begins part-way through the construct above it, so those exact lines 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–11 lines × 2) app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1608— app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1608-1614 | app/src/main/java/com/sameerasw/essentials/utils/DuoOverlayView.kt:1648-1658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/sameerasw/essentials/utils/DuoOverlayView.kt:1648` it begins part-way through the construct above it, so those exact lines 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 × 9) app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:254— app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:254-263 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:477-486 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:493-502 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:524-533 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:617-626 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:790-799 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:803-812 | app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:827-836 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/FlashlightPulseSettingsUI.kt:176-184 — there are 9 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 9 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:254` it begins part-way through the construct above it, so those 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/sameerasw/essentials/ui/composables/SetupFeatures.kt:802` calls `listOf` and `app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt:616` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 6) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:59— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:59-68 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt:58-67 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt:59-68 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingColorModePicker.kt:55-64 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.kt:74-83 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/NotificationLightingSystemModePicker.kt:60-69 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.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 (8–10 lines × 2) app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:381— app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:381-388 | app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt:427-436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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–10 lines × 3) app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:42— app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:42-51 | app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:59-68 | app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:75-79 — 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/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:42` calls `composeBoosted` and `app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:75` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 7) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt:53— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt:53-61 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/NetworkTypePicker.kt:63-71 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt:54-62 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingColorModePicker.kt:50-58 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.kt:69-77 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/GlowSidesPicker.kt:51-59 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/NotificationLightingSystemModePicker.kt:55-63 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.kt:66` calls `indexOf`, `coerceAtLeast`, `RoundedCardContainer` and `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/GlowSidesPicker.kt:49` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–9 lines × 4) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:108— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:108-115 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:103-110 | app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.kt:69-75 | app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ActionSequenceEditor.kt:94-102 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:106` calls `mutableStateOf` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:101` 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–9 lines × 3) app/src/main/java/com/sameerasw/essentials/ui/features/system/BackGestureSettingsUI.kt:526— app/src/main/java/com/sameerasw/essentials/ui/features/system/BackGestureSettingsUI.kt:526-532 | app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt:70-78 | app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt:72-80 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/sameerasw/essentials/ui/features/system/BackGestureSettingsUI.kt:526` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 5) app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:167— app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt:167-174 | app/src/main/java/com/sameerasw/essentials/ui/activities/LinkPickerActivity.kt:67-74 | app/src/main/java/com/sameerasw/essentials/ui/activities/LocationAlarmActivity.kt:74-81 | app/src/main/java/com/sameerasw/essentials/ui/activities/ShortcutHandlerActivity.kt:53-60 | app/src/main/java/com/sameerasw/essentials/ui/activities/ShutUpShortcutActivity.kt:55-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/sameerasw/essentials/ui/activities/LinkPickerActivity.kt:64` calls `enableEdgeToEdge` and `app/src/main/java/com/sameerasw/essentials/ui/activities/ShutUpShortcutActivity.kt:52` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:409— app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:409-416 | app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt:618-625 | app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt:204-211 — 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/sameerasw/essentials/services/handlers/FlashlightHandler.kt:409` it begins part-way through the construct above it, so those exact lines 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–8 lines × 2) app/src/main/java/com/sameerasw/essentials/island/plugins/calendar/CalendarExpanded.kt:90— app/src/main/java/com/sameerasw/essentials/island/plugins/calendar/CalendarExpanded.kt:90-95 | app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationExpanded.kt:143-150 — 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/sameerasw/essentials/island/plugins/calendar/CalendarExpanded.kt:90` 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 (7–8 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:100— app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:100-106 | app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt:96-103 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 547 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 8) app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:57— app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:57-63 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt:56-62 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/NetworkTypePicker.kt:66-72 | app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt:57-63 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingColorModePicker.kt:53-59 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.kt:72-78 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/GlowSidesPicker.kt:54-60 | app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/NotificationLightingSystemModePicker.kt:58-64 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 2) app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:316— app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:316-321 | app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:587-593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5–6 lines × 2) app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:990— app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:990-994 | app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt:1218-1223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (39 lines × 2) app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/DuoBatteryPercentageOptionsBottomSheet.kt:36— app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/DuoBatteryPercentageOptionsBottomSheet.kt:36-74 | app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/DuoNetworkOptionsBottomSheet.kt:36-74 — before extracting anything, compare `app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/DuoBatteryPercentageOptionsBottomSheet.kt` and `app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/DuoNetworkOptionsBottomSheet.kt` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/sameerasw/essentials/ui/features/display/sheets/DuoBatteryPercentageOptionsBottomSheet.kt:36` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) app/src/main/java/com/sameerasw/essentials/island/service/OverlayLifecycleOwner.kt:21— app/src/main/java/com/sameerasw/essentials/island/service/OverlayLifecycleOwner.kt:21-26 | app/src/main/java/com/sameerasw/essentials/services/handlers/PocketModeHandler.kt:193-198 | app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt:458-463 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10 lines × 7) app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:275— app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:275-284 | app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:335-344 | app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:354-364 | app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:373-382 | app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:391-400 | app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:409-418 | app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:427-436 — 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/sameerasw/essentials/ui/components/dialogs/AboutSection.kt:275` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Off the main sequence: :island-sdk — :island-sdk: abstractness 0.04, instability 0.00, distance 0.96 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
No structured logging — No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.
Duplicated predicate app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt:490— `!ShellUtils.isAvailable(context) || !ShellUtils.hasPermission(context)` appears character-identically in 4 files — app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt, app/src/main/java/com/sameerasw/essentials/utils/BluetoothBatteryUtils.kt, app/src/main/java/com/sameerasw/essentials/utils/HiddenDebuggingUtils.kt, app/src/main/java/com/sameerasw/essentials/utils/PermissionGrantUtil.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/sameerasw/essentials/data/repository/HelpMediaRepository.kt:42— `!cachedJson.isNullOrEmpty() && !isCacheStale` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/data/repository/HelpMediaRepository.kt, app/src/main/java/com/sameerasw/essentials/data/repository/ProjectDetailsRepository.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/sameerasw/essentials/services/handlers/DuoTouchHandler.kt:232— `!didPerformAnyGesture && totalDist < touchSlopPx && elapsed < 350L` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/services/handlers/DuoTouchHandler.kt, app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceTouchHandler.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/sameerasw/essentials/domain/watermark/WatermarkEngine.kt:916— `!exif.make.isNullOrEmpty() && !exif.model.isNullOrEmpty()` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt, app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.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/sameerasw/essentials/services/tiles/BaseTileService.kt:88— `!isDeviceSupported() && !areUnsupportedFeaturesEnabled()` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/services/tiles/BaseTileService.kt, app/src/main/java/com/sameerasw/essentials/services/tiles/LockdownTileService.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/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt:309— `!it.isUpdateAvailable && it.mappedPackageName != null` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt, app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.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/sameerasw/essentials/services/handlers/DuoTouchHandler.kt:137— `(downTime - lastTapTime) < doubleTapTimeoutMs && hypot(x - lastTapX, y - lastTapY) < touchSlopPx * 1.5f` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/services/handlers/DuoTouchHandler.kt, app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceTouchHandler.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/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt:116— `(isShizukuAvailable && isShizukuGranted) || (isRootAvailable && isRootGranted)` appears character-identically in 3 files — app/src/main/java/com/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt, app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt, app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.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/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt:830— `Build.VERSION.SDK_INT < Build.VERSION_CODES.S || context.checkSelfPermission(Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMIS…` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt, app/src/main/java/com/sameerasw/essentials/island/plugins/devices/DevicesPlugin.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/sameerasw/essentials/services/tiles/DataSimController.kt:124— `Build.VERSION.SDK_INT >= 28 && !exemptionsApplied` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/services/tiles/DataSimController.kt, app/src/main/java/com/sameerasw/essentials/utils/media/AppVolumeController.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/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:71— `Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && vibrator.areAllPrimitivesSupported(VibrationEffect.Composition.PRIMITIVE_CLICK)` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt, app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.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/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt:37— `Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && vibrator.areAllPrimitivesSupported(VibrationEffect.Composition.PRIMITIVE_LOW_TICK)` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt, app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.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/sameerasw/essentials/services/handlers/AppVolumeOverlayHandler.kt:291— `Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && isDark` appears character-identically in 3 files — app/src/main/java/com/sameerasw/essentials/services/handlers/AppVolumeOverlayHandler.kt, app/src/main/java/com/sameerasw/essentials/services/handlers/FaceUnlockBrightnessHandler.kt, app/src/main/java/com/sameerasw/essentials/services/handlers/LockscreenShortcutsHandler.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/sameerasw/essentials/services/tiles/EssentialsOnDisplayTileService.kt:35— `PermissionUtils.isAccessibilityServiceEnabled(this) && PermissionUtils.hasNotificationListenerPermission(this)` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/services/tiles/EssentialsOnDisplayTileService.kt, app/src/main/java/com/sameerasw/essentials/services/tiles/IslandTileService.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/sameerasw/essentials/services/tiles/RestartSystemUiTileService.kt:61— `RootUtils.isRootAvailable() && RootUtils.isRootPermissionGranted()` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/services/tiles/RestartSystemUiTileService.kt, app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.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/sameerasw/essentials/domain/model/AppPermission.kt:162— `ShellUtils.isAvailable(context) && ShellUtils.hasPermission(context)` appears character-identically in 4 files — app/src/main/java/com/sameerasw/essentials/domain/model/AppPermission.kt, app/src/main/java/com/sameerasw/essentials/ui/core/sheets/HiddenDebuggingHelpBottomSheet.kt, app/src/main/java/com/sameerasw/essentials/utils/battery/ChargingModeUtil.kt, app/src/main/java/com/sameerasw/essentials/utils/hardware/WifiUtil.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/sameerasw/essentials/services/tiles/ChargeQuickTileService.kt:116— `ShellUtils.isAvailable(this) && ShellUtils.hasPermission(this)` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/services/tiles/ChargeQuickTileService.kt, app/src/main/java/com/sameerasw/essentials/services/tiles/DefaultLauncherTileService.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/sameerasw/essentials/data/repository/SettingsRepository.kt:3114— `ShizukuUtils.isShizukuAvailable() && ShizukuUtils.hasPermission()` appears character-identically in 4 files — app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt, app/src/main/java/com/sameerasw/essentials/services/tiles/RestartSystemUiTileService.kt, app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt, app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.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/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt:94— `System.currentTimeMillis() - downTime >= 400L && !longPressed` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt, app/src/main/java/com/sameerasw/essentials/ui/core/pickers/SegmentedPicker.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/sameerasw/essentials/island/plugins/navigation/NavigationPlugin.kt:142— `c.focusedKey() == ITEM_KEY && c.currentStage() == IslandStage.Expanded` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/island/plugins/navigation/NavigationPlugin.kt, app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:199— `checked && !viewModel.isAccessibilityEnabled.value` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt, app/src/main/java/com/sameerasw/essentials/ui/features/system/FaceUnlockBrightnessSettingsUI.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/sameerasw/essentials/services/tiles/AlwaysOnDisplayTileService.kt:32— `com.sameerasw.essentials.utils.PermissionUtils .canWriteSecureSettings(this) || (ShellUtils.isAvailable(this) && ShellUtils.hasPermission(th…` appears character-identically in 2 files — app/src/main/java/com/sameerasw/essentials/services/tiles/AlwaysOnDisplayTileService.kt, app/src/main/java/com/sameerasw/essentials/services/tiles/NfcTileService.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/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt:167— `controller != null && excludedPackages.contains(controller.packageName)` appears character-identically in 3 files — app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt, app/src/main/java/com/sameerasw/essentials/services/handlers/DuoOverlayHandler.kt, app/src/main/java/com/sameerasw/essentials/services/handlers/StatusGlanceHandler.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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:877— `currentAction != null && currentAction::class == action::class` appears character-identically in 3 files — app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt, app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt, app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.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/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt:879— `currentAction != null && currentAction::class == resolvedAction::class` appears character-identically in 3 files — app/src/main/java/com/sameerasw/essentials/ui/features/display/DuoSettingsUI.kt, app/src/main/java/com/sameerasw/essentials/ui/features/display/StatusGlanceSettingsUI.kt, app/src/main/java/com/sameerasw/essentials/ui/features/display/actions/GestureActionPickerSheet.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/sameerasw/essentials/data/repository/LocationReachedRepository.kt:109— `getAlarms` 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.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1311— `getFreezeTags` 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.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:1335— `getFreezeAppTagMap` swallows every exception into `emptyMap()` — 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/sameerasw/essentials/data/repository/SettingsRepository.kt:1807— `getShutUpOriginalSettings` swallows every exception into `emptyMap()` — 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/sameerasw/essentials/data/repository/SettingsRepository.kt:2006— `getAllConfigsAsJsonString` swallows every exception into `"{}"` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:2162— `getBluetoothDevicesBattery` 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.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:2320— `getTrackedRepos` 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.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:2963— `getFontScale` swallows every exception into `1.0f` — 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/sameerasw/essentials/data/repository/SettingsRepository.kt:2995— `getFontWeight` 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/sameerasw/essentials/data/repository/SettingsRepository.kt:3074— `loadBackGestureAppConfigs` 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.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt:3164— `getAnimationScale` swallows every exception into `1.0f` — 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/sameerasw/essentials/data/repository/SettingsRepository.kt:3644— `getScreenTimeout` swallows every exception into `30000L` — 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/sameerasw/essentials/data/repository/SettingsRepository.kt:4351— `getIslandCalendarIcons` swallows every exception into `emptyMap()` — 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/sameerasw/essentials/domain/diy/ActionGsonAdapter.kt:88— `listFromJson` 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.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/domain/model/github/BugReportFields.kt:169— `appVersion` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/island/plugins/devices/DevicesPlugin.kt:236— `batteryOf` swallows every exception into `-1` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt:416— `startPowerListening` 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.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt:1850— `getMediaSessions` 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.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/services/WatchNotificationSyncManager.kt:66— `getAllowedApps` swallows every exception into `emptySet()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt:896— `getMediaSessions` 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.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/services/tiles/CaffeinateTileService.kt:103— `getScreenOffTimeout` swallows every exception into `60000L` — 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/sameerasw/essentials/services/tiles/QsTileRegistry.kt:264— `getTileLabel` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt:323— `getTileSubtitle` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/java/com/sameerasw/essentials/translation/TranslatableText.kt:71— `TranslatableText` swallows every exception into `"unknown"` — 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/sameerasw/essentials/ui/features/audio/ShutUpSettingsUI.kt:249— `loadEnabledKeyboards` 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.
Hand-rolled JSON/XML parsing via regex app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt:5222— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt:1359— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
No ADRs found app/build.gradle.kts:5— 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 5).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion app/build.gradle.kts:1— `app` (193568 LoC, 1699 module-visible types across 135 directories) overshoots its size bounds. 1 of 5 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 6.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
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.
No SAST REDACTED:4— 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) as a CI step. What was searched, so you can tell an absence from a miss: the 7 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:166— `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/8 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) and a Gradle version catalogue — 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 16 file(s) — `app/src/main/java/com/sameerasw/essentials/domain/diy/SystemMetricTracker.kt`, `app/src/main/java/com/sameerasw/essentials/island/plugins/alarm/AlarmPlugin.kt`, `app/src/main/java/com/sameerasw/essentials/island/plugins/brief/BriefPlugin.kt`, `app/src/main/java/com/sameerasw/essentials/island/plugins/caffeinate/CaffeinatePlugin.kt`, `app/src/main/java/com/sameerasw/essentials/island/plugins/navigation/NavigationPlugin.kt`, … (+11 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
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) and a Gradle version catalogue — not scanned yet).
0
—
Run 01a1e554-2036-7caa-a94a-e99bdff55282 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 16 · Warnings: 1502 · Recommendations: 87 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 17:07 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.