Public report of shiaho777/web-to-app, published 24 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 24 October 2026, 21:17 UTC · Survey ID cd_3b1c0c9c12a44b25acdbfb6a4a25b42d
shiaho777/web-to-app
Measured 24 October 2026, 20:53 UTC, at code version fd84c2d
Regression: 1 dimension fell since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAt riskDown 13 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 309,611 lines of product code in 38 projects, tests not counted · Estimated rebuild effort: about 2.0 person-years · Weakest lens: Production Readiness, 24
Findings by how serious they are
27 critical1652 serious138 minor
12 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
24 October 2026, 20:53 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
60of 63 dimensions measured by tools. The other 3 are advisory notes from an AI model, which explain the code but don't count towards the score.
1784of 1817 findings point to an exact file and line, so you can open each one in the code. The other 33 concern the repository as a whole, such as missing documentation.
63dimensions across 6 lenses, read from 309,611 lines of product code in 38 projects.
shiaho777/web-to-app scores 42 out of 100, but it is rated At risk while a critical security finding is open; the score itself is unchanged.
The weakest lens counts most in the score, and here that is Production Readiness, which scores 24 and is rated Critical. Its Secret Scanning dimension scores 0 out of 10, and until that reaches 4, Production Readiness can't be rated higher than Adequate. The first actions are to resolve the 2 Leaked secret finding(s) in Secret Scanning and to resolve the 1 No ADRs found finding(s) in ADR Quality, and if Production Readiness rose to 70, the score would rise from 42 to about 56.
27 findings are critical: 19 in Static Analysis (SAST), four in Dependency Vulnerabilities, two in Secret Scanning and two in Secrets (history).
Watchdog couldn't measure 12 dimensions in this code, among them Code Coverage, Test Reliability and License Compliance, so they are left out of the score. The product code is 309,611 lines, which would take an estimated 2.0 person-years, around €290,000, to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Outbound HTTP resilience · Outbound HTTP without resilience app/src/main/java/com/webtoapp/core/webview/TranslateProxyRoute.kt
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 503 findings
These 503 critical or serious findings were in the previous survey, on 10 October 2026, and are gone from this one. The first 100 are listed here.
Exception handling · Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/core/errorpage/ErrorPageManager.kt
Exception handling · Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/core/export/AppSourcePackager.kt
Exception handling · Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/core/export/AppExporter.kt
Exception handling · Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/core/extension/ExtensionModule.kt
Exception handling · Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/core/extension/ExtensionModule.kt
Exception handling · Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/core/extension/ExtensionModule.kt
Exception handling · Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/core/extension/ExtensionFileManager.kt
Exception handling · Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/core/extension/DeclarativeNetRequestEngine.kt
Exception handling · Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/core/extension/DeclarativeNetRequestEngine.kt
Exception handling · Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/core/extension/DeclarativeNetRequestEngine.kt
Rebuild cost: about €290,000 · Estimate
Cost to rebuild
€97,000 to €490,000, for 1,612 to 5,115 hours of work, about 2.0 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 42. 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: 309,611 lines of product code
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED.
Raises the score by about 16 points · Low effort · Secret Scanning
2
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 7 points · Low effort · ADR Quality
3
Resolve the 3 Deprecated module finding(s) in Dependency Hygiene.
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 €290,000 to build again, about 2.0 person-years of work. Its weakest lens is Production Readiness, at 24 (Critical). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 2 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 16 points for low effort, because it clears the 2 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.0 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 355,120 lines over the last 90 days, which is about 1,440,209 lines a year. At that pace, the extra work comes to an estimated 178.9 to 1073.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: 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.
750 modules, with 866 dependencies between them. 16 loops run through 58 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 710 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.
core.agent.permission uses core.agent.tool, so a change to core.agent.tool can break core.agent.permission, while a change to core.agent.permission can't break core.agent.tool.
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.
core.agent.session uses core.agent.files, so a change to core.agent.files can break core.agent.session, while a change to core.agent.session can't break core.agent.files.
Position
Below the diagonal: core.agent.session uses a module listed above it, which is the healthy direction.
11→18 core.appearance uses data.modelpart of a loop✕
Connections
1 pair of types, where a type in core.appearance uses a type in data.model.
core.apkbuilder uses core.apkbuilder.JarSigner, so a change to core.apkbuilder.JarSigner can break core.apkbuilder, while a change to core.apkbuilder can't break core.apkbuilder.JarSigner.
Position
Below the diagonal: core.apkbuilder uses a module listed above it, which is the healthy direction.
core.apkbuilder uses core.appearance, so a change to core.appearance can break core.apkbuilder, while a change to core.apkbuilder can't break core.appearance.
Position
Below the diagonal: core.apkbuilder uses a module listed above it, which is the healthy direction.
core.apkbuilder uses core.crypto, so a change to core.crypto can break core.apkbuilder, while a change to core.apkbuilder can't break core.crypto.
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.
16→18 core.apkbuilder uses data.modelpart of a loop✕
Connections
45 pairs of types, where a type in core.apkbuilder uses a type in data.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
core.playstore.aab uses core.apkbuilder.JarSigner, so a change to core.apkbuilder.JarSigner can break core.playstore.aab, while a change to core.playstore.aab can't break core.apkbuilder.JarSigner.
Position
Below the diagonal: core.playstore.aab uses a module listed above it, which is the healthy direction.
core.playstore.aab uses core.apkbuilder, so a change to core.apkbuilder can break core.playstore.aab, while a change to core.playstore.aab can't break core.apkbuilder.
Position
Below the diagonal: core.playstore.aab uses a module listed above it, which is the healthy direction.
core.playstore.aab uses data.model, so a change to data.model can break core.playstore.aab, while a change to core.playstore.aab can't break data.model.
Position
Below the diagonal: core.playstore.aab uses a module listed above it, which is the healthy direction.
core.agent.export uses core.agent.files, so a change to core.agent.files can break core.agent.export, while a change to core.agent.export can't break core.agent.files.
Position
Below the diagonal: core.agent.export uses a module listed above it, which is the healthy direction.
core.agent.export uses core.extension, so a change to core.extension can break core.agent.export, while a change to core.agent.export can't break core.extension.
Position
Below the diagonal: core.agent.export uses a module listed above it, which is the healthy direction.
core.agent.export uses data.repository, so a change to data.repository can break core.agent.export, while a change to core.agent.export can't break data.repository.
Position
Below the diagonal: core.agent.export uses a module listed above it, which is the healthy direction.
core.agent.tool uses core.agent.files, so a change to core.agent.files can break core.agent.tool, while a change to core.agent.tool can't break core.agent.files.
Position
Below the diagonal: core.agent.tool uses a module listed above it, which is the healthy direction.
core.agent.tool uses core.agent.permission, so a change to core.agent.permission can break core.agent.tool, while a change to core.agent.tool can't break core.agent.permission.
Position
Below the diagonal: core.agent.tool uses a module listed above it, which is the healthy direction.
core.agent.tool uses data.repository, so a change to data.repository can break core.agent.tool, while a change to core.agent.tool can't break data.repository.
Position
Below the diagonal: core.agent.tool uses a module listed above it, which is the healthy direction.
core.appmodifier uses core.apkbuilder, so a change to core.apkbuilder can break core.appmodifier, while a change to core.appmodifier can't break core.apkbuilder.
Position
Below the diagonal: core.appmodifier uses a module listed above it, which is the healthy direction.
core.appmodifier uses core.activation, so a change to core.activation can break core.appmodifier, while a change to core.appmodifier can't break core.activation.
Position
Below the diagonal: core.appmodifier uses a module listed above it, which is the healthy direction.
ui.components uses core.appearance, so a change to core.appearance can break ui.components, while a change to ui.components can't break core.appearance.
Position
Below the diagonal: ui.components uses a module listed above it, which is the healthy direction.
28 pairs of types, where a type in ui.components uses a type in data.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
ui.components uses core.activation, so a change to core.activation can break ui.components, while a change to ui.components can't break core.activation.
Position
Below the diagonal: ui.components uses a module listed above it, which is the healthy direction.
44 pairs of types, where a type in ui.viewmodel uses a type in data.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
core.agent.llm uses core.agent.tool, so a change to core.agent.tool can break core.agent.llm, while a change to core.agent.llm can't break core.agent.tool.
Position
Below the diagonal: core.agent.llm uses a module listed above it, which is the healthy direction.
ui.agent.components uses core.agent.files, so a change to core.agent.files can break ui.agent.components, while a change to ui.agent.components can't break core.agent.files.
Position
Below the diagonal: ui.agent.components uses a module listed above it, which is the healthy direction.
ui.agent.components uses core.agent.permission, so a change to core.agent.permission can break ui.agent.components, while a change to ui.agent.components can't break core.agent.permission.
Position
Below the diagonal: ui.agent.components uses a module listed above it, which is the healthy direction.
ui.agent.components uses core.agent.session, so a change to core.agent.session can break ui.agent.components, while a change to ui.agent.components can't break core.agent.session.
Position
Below the diagonal: ui.agent.components uses a module listed above it, which is the healthy direction.
ui.agent.components uses core.agent.export, so a change to core.agent.export can break ui.agent.components, while a change to ui.agent.components can't break core.agent.export.
Position
Below the diagonal: ui.agent.components uses a module listed above it, which is the healthy direction.
ui.agent.components uses core.agent.tool, so a change to core.agent.tool can break ui.agent.components, while a change to ui.agent.components can't break core.agent.tool.
Position
Below the diagonal: ui.agent.components uses a module listed above it, which is the healthy direction.
34→40 ui.agent.components uses ui.agentpart of a loop✕
Connections
13 pairs of types, where a type in ui.agent.components uses a type in ui.agent.
core.agent.engine uses core.agent.permission, so a change to core.agent.permission can break core.agent.engine, while a change to core.agent.engine can't break core.agent.permission.
Position
Below the diagonal: core.agent.engine uses a module listed above it, which is the healthy direction.
core.agent.engine uses core.agent.session, so a change to core.agent.session can break core.agent.engine, while a change to core.agent.engine can't break core.agent.session.
Position
Below the diagonal: core.agent.engine uses a module listed above it, which is the healthy direction.
core.agent.engine uses core.agent.tool, so a change to core.agent.tool can break core.agent.engine, while a change to core.agent.engine can't break core.agent.tool.
Position
Below the diagonal: core.agent.engine uses a module listed above it, which is the healthy direction.
core.agent.engine uses core.agent.llm, so a change to core.agent.llm can break core.agent.engine, while a change to core.agent.engine can't break core.agent.llm.
Position
Below the diagonal: core.agent.engine uses a module listed above it, which is the healthy direction.
ui.screens uses core.apkbuilder.JarSigner, so a change to core.apkbuilder.JarSigner can break ui.screens, while a change to ui.screens can't break core.apkbuilder.JarSigner.
Position
Below the diagonal: ui.screens uses a module listed above it, which is the healthy direction.
79 pairs of types, where a type in ui.screens uses a type in data.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
ui.screens uses core.playstore.aab, so a change to core.playstore.aab can break ui.screens, while a change to ui.screens can't break core.playstore.aab.
Position
Below the diagonal: ui.screens uses a module listed above it, which is the healthy direction.
core.agent.runtime uses core.agent.permission, so a change to core.agent.permission can break core.agent.runtime, while a change to core.agent.runtime can't break core.agent.permission.
Position
Below the diagonal: core.agent.runtime uses a module listed above it, which is the healthy direction.
core.agent.runtime uses core.agent.session, so a change to core.agent.session can break core.agent.runtime, while a change to core.agent.runtime can't break core.agent.session.
Position
Below the diagonal: core.agent.runtime uses a module listed above it, which is the healthy direction.
core.agent.runtime uses core.agent.tool, so a change to core.agent.tool can break core.agent.runtime, while a change to core.agent.runtime can't break core.agent.tool.
Position
Below the diagonal: core.agent.runtime uses a module listed above it, which is the healthy direction.
core.agent.runtime uses core.agent.llm, so a change to core.agent.llm can break core.agent.runtime, while a change to core.agent.runtime can't break core.agent.llm.
Position
Below the diagonal: core.agent.runtime uses a module listed above it, which is the healthy direction.
core.agent.runtime uses core.agent.engine, so a change to core.agent.engine can break core.agent.runtime, while a change to core.agent.runtime can't break core.agent.engine.
Position
Below the diagonal: core.agent.runtime uses a module listed above it, which is the healthy direction.
ui.agent uses core.agent.permission, so a change to core.agent.permission can break ui.agent, while a change to ui.agent can't break core.agent.permission.
Position
Below the diagonal: ui.agent uses a module listed above it, which is the healthy direction.
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
25
High / Critical
A03:2025 — Software Supply Chain Failures
12
High / Critical
A07:2025 — Authentication Failures
5
High / Critical
Roadmap
Immediately resolve the two leaked secrets in the codebase and establish a practice of documenting significant design decisions in a dedicated ADR folder. Simultaneously, reconcile the documentation to ensure all links and references accurately reflect the current project structure. Finally, integrate a static analysis security tool into the CI pipeline to automatically block security regressions before they are merged.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED.
Reconcile the README with reality: docs/index.md links to `/guide/app-types/`, but `guide/app-types` does not exist; docs/index.md links to `/guide/app-types/web`, but `guide/app-types/web` does not exist; docs/index.md links to `/guide/app-types/html`, but `guide/app-types/html` does not exist; docs/index.md links to `/guide/app-types/frontend`, but `guide/app-types/frontend` does not exist; docs/index.md links to `/guide/app-types/nodejs`, but `guide/app-types/nodejs` does not exist.
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.
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 27
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 — 1652
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 — 138
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 12
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 60 of 63 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 63 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, 1784 of 1817 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.kt) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (JaCoCo XML — the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (JaCoCo XML — the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.kt) 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.
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 (9 contributor(s) across 1130 commit(s) sampled, automation and bot accounts excluded). One of them holds 97% of the history; the other 8 hold 0.4% 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.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (clone-host/build.gradle.kts), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `app/src/main/java/com/webtoapp/WebToAppApplication.kt`, `app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt`, `app/src/main/java/com/webtoapp/core/ads/api/AdsFeatureApi.kt`, `app/src/main/java/com/webtoapp/core/agent/files/ProjectFileManager.kt`, `app/src/main/java/com/webtoapp/core/agent/tool/builtin/AppLifecycleTools.kt`, … (+44 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.
AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository's container is Koin, whose lifetimes are not modelled 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.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing 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.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Boot via AndroidApp (app). the Android app did not build — `./gradlew :app:assembleDebug` exited 1: ot in 'org.gradle' namespace)
- Included Builds (No included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.android:org.jetbrains.kotlin.and…; 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Go, Kotlin, PHP, Python, Vue components, c, cpp 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Go, Kotlin, PHP, Python, Vue components, c, cpp 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 647 further occurrence(s) are not listed individually; the score already reflects all 687.
P1 CI/CD gates — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 473 further occurrence(s) are not listed individually; the score already reflects all 513.
X7 Silent fallback defaults — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 6 further occurrence(s) are not listed individually; the score already reflects all 46.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
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").
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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned REDACTED, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, 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.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (3): D19, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
246 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was WebViewActivityKt.WebViewScreen at 424. A further 26 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 SvgIconMapper.getIcon at 227 — they are counted neither in the figure above nor in this dimension's score. 12 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/webtoapp/util/SvgIconMapper.kt (SvgIconMapper.getIcon at 227), app/src/main/java/com/webtoapp/ui/screens/ExportPermissionTitles.kt (ExportPermissionTitlesKt.exportPermissionTitle at 88), app/src/main/java/com/webtoapp/core/webview/ShareBridge.kt (ShareBridgeKt.mimeTypeForFileExtension at 64), app/src/main/java/com/webtoapp/ui/agent/components/SyntaxHighlight.kt (SyntaxHighlight.rulesFor at 50), app/src/main/java/com/webtoapp/ui/plugin/PluginSurface.kt (PluginSurfaceKt.pluginIcon at 35), and 7 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 240 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 240 down to 240 or less in Cyclomatic Complexity — start with WebViewActivityKt.WebViewScreen (cyclomatic 424). — Refactoring it lifts Cyclomatic Complexity from 3.2 to about 4.0/10.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 346 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 10 bodies over 120 down to 120 or less in Cognitive Complexity — start with WebViewActivityKt.WebViewScreen (cognitive 675), WebViewManager.createWebViewClient (cognitive 353), CreateHtmlAppScreenKt.CreateHtmlAppScreen (cognitive 183). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 10 together lifts Cognitive Complexity from 2.0 to about 3.7/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.8 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 143 MethodTooLong finding(s) in God Classes — start with CreateAppWebViewCards.kt (9), CreateGalleryAppScreen.kt (6), CreateAppApkSection.kt (5). — One of this dimension's main actionable groups (143 warning-level).
Resolve the 80 FileTooLong finding(s) in God Classes — start with Strings.kt, WebViewManager.kt, ApkBuilder.kt. — One of this dimension's main actionable groups (80 warning-level).
Resolve the 27 TooManyMethods finding(s) in God Classes — start with ChromeExtensionRuntime.kt (2), GeckoViewEngine.kt (2), WebViewManager.kt. — One of this dimension's main actionable groups (27 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
548 duplicated block group(s) detected. A further 26 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 147 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 36 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with AiApiClient.kt (7), GeckoViewEngine.kt (2), GalleryPlayerScreen.kt (2). — One of this dimension's main actionable groups (36 warning-level).
Resolve the 28 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with CreateNodeJsAppScreen.kt (3), AiApiClient.kt, ApkBuilder.kt. — One of this dimension's main actionable groups (28 warning-level).
Resolve the 24 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with AiApiClient.kt (4), BgmSelector.kt (3), CreateAppWebViewCards.kt (3). — One of this dimension's main actionable groups (24 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
25 production modules (Gradle+npm+Go+CMake), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 0 module(s) off the main sequence, with abstractness counted on 9 of the 25 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with ApkTemplate.kt, GoRuntime.kt, PhpAppRuntime.kt. — One of this dimension's main actionable groups (5 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
6 outdated, 3 author-deprecated direct Go module(s), 9 pinning or checksum defect(s). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.
No go.sum committed (app/src/main/assets/sample_projects/go-echo-en/go.mod)
No go.sum committed (app/src/main/assets/sample_projects/go-echo/go.mod)
No go.sum committed (REDACTED)
+ 6 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 Deprecated module finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 No go.sum committed (app/src/main/assets/sample_projects/go-echo-ar/go.m… finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 No go.sum committed (app/src/main/assets/sample_projects/go-echo-en/go.m… finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_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.
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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/webtoapp/ui/webview/WebViewActivity.kt (86×424=36464); app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt (61×224=13664); app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt (87×99=8613) Repeated repair below the complexity floor: app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt (6 of 9 changes were fixes); app/src/main/java/com/webtoapp/core/golang/GoToolchainManager.kt (6 of 8 changes were fixes); app/src/main/java/com/webtoapp/core/wordpress/WordPressDependencyManager.kt (6 of 8 changes were fixes)
Resolve the 84 Hotspot finding(s) in Churn × Complexity Hotspots — start with WebViewActivity.kt, WebViewManager.kt, ApkBuilder.kt. — One of this dimension's main actionable groups (84 warning-level).
Resolve the 18 Repeated repair finding(s) in Churn × Complexity Hotspots — start with ApkTemplate.kt, GoToolchainManager.kt, WordPressDependencyManager.kt. — One of this dimension's main actionable groups (18 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 309611 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: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
This repository is exceptionally well documented: the root README (7k words) gives a compelling overview and an on-device APK workshop description with a star+fork badge, while architecture/Docs markdown files alone at 190 documents cover every tier of the project. The modules/README.md directory README is focused on its own Plugin Market, which it does document; no repository-wide overview, installation, or usage guidance appears in any module's README, so those fall to the root level. All visible documents are clear and well-structured with headings, an outline, and a consistent theme. This repository's documentation is comprehensive and well-structured. It includes a README for each directory (e.g. remote activation, architecture, config drift) that explains what the directory does and how to use its contents, plus an architecture/design doc set of 190 markdown files covering every major topic such as preview/export contracts, shell sync, F-Droid flavor behavior, and internationalization. The documents are well-organized with clear headings and a consistent outline; each named section exists in the visible portion. A comprehensive documentation set for WebToApp extensions: the READMEs and architecture/Docs markdown files cover each tier — HCJ plugin APIs, MV3 Chrome extension manifest fields, CSS injection, native bridge, and userscript interop — with a clear status legend (✅ functional, 🟡 partial, ⬜ stub) across every API table. The outline is visible in the middle of each document, so any missing section would be flagged by its own outline rather than being marked as clipped.
Documentation: written for insiders · ×2docs/developer/index.md
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
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.
2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 2 High secret finding(s) in Secrets (history) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
25 finding(s): 0 critical, 19 high, 6 medium, 0 low. 18 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 18 file(s) — `app/src/main/cpp/browser_kernel.c` (line 378, line 384, line 401), `app/src/main/cpp/perf_engine.c` (line 280, line 289, line 295, …), `app/src/main/cpp/static_exec_loader.c` (line 583, line 584, line 732, …), `app/src/main/cpp/sys_optimizer.c` (line 307, line 329, line 335, …), `app/src/main/java/com/webtoapp/WebToAppApplication.kt` (line 216), … (+13 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 warning-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 18 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 (18 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 any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_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.
2 of 598 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt. Counted over 598 of the 734 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 6 Change coupling finding(s) in Change Coupling — start with ApkConfig.kt (2), ApkBuilder.kt, ShellDialogs.kt. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 4 Change-coupling hub finding(s) in Change Coupling — start with ApkConfigJsonFactory.kt, Strings.kt, WebViewActivity.kt. — One of this dimension's main actionable groups (4 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.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 13 platform declaration(s) and 91 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.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add a README to the 5 of 6 project(s) that lack one — worth up to 1.7 pts.
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 README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
docs/index.md links to `/guide/app-types/`, but `guide/app-types` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:51
docs/index.md links to `/guide/app-types/web`, but `guide/app-types/web` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:51
docs/index.md links to `/guide/app-types/html`, but `guide/app-types/html` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:51
docs/index.md links to `/guide/app-types/frontend`, but `guide/app-types/frontend` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:51
docs/index.md links to `/guide/app-types/nodejs`, but `guide/app-types/nodejs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:51
docs/index.md links to `/guide/app-types/php`, but `guide/app-types/php` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:51
docs/index.md links to `/guide/app-types/python`, but `guide/app-types/python` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:51
docs/index.md links to `/guide/app-types/go`, but `guide/app-types/go` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:51
docs/index.md links to `/guide/app-types/wordpress`, but `guide/app-types/wordpress` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:51
docs/index.md links to `/guide/more-features/about`, but `guide/more-features/about` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:51
docs/index.md links to `/guide/config/`, but `guide/config` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:55
docs/index.md links to `/guide/app-actions/build-apk`, but `guide/app-actions/build-apk` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:59
docs/index.md links to `/guide/app-actions/share-apk`, but `guide/app-actions/share-apk` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:59
docs/index.md links to `/guide/app-actions/export-apk`, but `guide/app-actions/export-apk` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:59
docs/index.md links to `/guide/more-features/google-play`, but `guide/more-features/google-play` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:59
docs/index.md links to `/guide/app-types/multi-web`, but `guide/app-types/multi-web` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:69
docs/index.md links to `/guide/app-types/media`, but `guide/app-types/media` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:109
docs/index.md links to `/guide/more-features/agent`, but `guide/more-features/agent` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:123
docs/index.md links to `/guide/more-features/extension-modules`, but `guide/more-features/extension-modules` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:131
docs/index.md links to `/guide/more-features/hosts-adblock`, but `guide/more-features/hosts-adblock` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:139
docs/index.md links to `/guide/more-features/linux-environment`, but `guide/more-features/linux-environment` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:147
docs/index.md links to `/guide/more-features/port-manager`, but `guide/more-features/port-manager` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:155
docs/index.md links to `/guide/more-features/app-modifier`, but `guide/more-features/app-modifier` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:163
docs/index.md links to `/developer/architecture`, but `developer/architecture` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:185
docs/index.md links to `/guide/getting-started`, but `guide/getting-started` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:191
docs/developer/contributing.md links to `/developer/recipes#verify-commands`, but `developer/recipes` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/developer/contributing.md:30
docs/developer/contributing.md links to `/developer/i18n`, but `developer/i18n` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/developer/contributing.md:31
docs/developer/contributing.md links to `/developer/config-drift#adding-a-setting-that-affects-the-generated-apk`, but `developer/config-drift` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/developer/contributing.md:32
docs/developer/export-pipeline.md links to `/developer/config-drift`, but `developer/config-drift` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/developer/export-pipeline.md:42
docs/developer/index.md links to `/developer/architecture`, but `developer/architecture` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/developer/index.md:58
docs/developer/index.md links to `/developer/export-pipeline`, but `developer/export-pipeline` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/developer/index.md:59
docs/developer/index.md links to `/developer/shell-sync`, but `developer/shell-sync` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/developer/index.md:60
docs/developer/index.md links to `/developer/config-drift`, but `developer/config-drift` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/developer/index.md:61
docs/developer/index.md links to `/developer/fdroid`, but `developer/fdroid` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/developer/index.md:62
docs/developer/recipes.md links to `/developer/i18n`, but `developer/i18n` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/developer/recipes.md:10
docs/developer/recipes.md links to `/developer/config-drift`, but `developer/config-drift` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/developer/recipes.md:22
docs/extensions/chrome-mv3.md links to `/extensions/api-reference`, but `extensions/api-reference` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/extensions/chrome-mv3.md:36
docs/extensions/css-module.md links to `/extensions/js-module`, but `extensions/js-module` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/extensions/css-module.md:3
docs/extensions/index.md links to `/extensions/js-module`, but `extensions/js-module` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/extensions/index.md:7
docs/extensions/index.md links to `/extensions/userscript`, but `extensions/userscript` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/extensions/index.md:8
What to do
Reconcile the README with reality: docs/index.md links to `/guide/app-types/`, but `guide/app-types` does not exist; docs/index.md links to `/guide/app-types/web`, but `guide/app-types/web` does not exist; docs/index.md links to `/guide/app-types/html`, but `guide/app-types/html` does not exist; docs/index.md links to `/guide/app-types/frontend`, but `guide/app-types/frontend` does not exist; docs/index.md links to `/guide/app-types/nodejs`, but `guide/app-types/nodejs` does not exist.
Do you agree with this assessment?
P1 · CI/CD gates8.5 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
What to do
Run the test suite in CI via an explicit runner step (`./gradlew test` for the toolchain this pipeline already uses) and gate merges on it.
Do you agree with this assessment?
P2 · Observability5.4 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 4/34 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `app/src/main/assets/sample_projects/go-fiber`, `app/src/main/assets/sample_projects/go-fiber-ar`, `app/src/main/assets/sample_projects/go-fiber-en`, `app/src/main/assets/sample_projects/go-gin`, `app/src/main/assets/sample_projects/go-gin-ar` and 25 more.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add OpenTelemetry tracing/metrics (opentelemetry-java or Micrometer) so requests are traceable across the system, not just health-probable.
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 15094 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.
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.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where Watchdog can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads it.
Do you agree with this assessment?
P5 · DR & Backup3.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
Codify backups + geo-recovery in IaC (snapshot/replication/geo-redundant) to back the DR plan.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — app/src/main/java/com/webtoapp/core/webview/TranslateProxyRoute.kt:54
What to do
Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 152 use(s) across 330,827 production line(s) (~0.5/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Go: on hot paths, reuse buffers and objects through sync.Pool, preallocate slices and maps with make([]T, 0, n) / make(map[K]V, n), size builders with Grow, append with strconv.Append*, and reslice with buf[:0] instead of allocating anew.
Kotlin: on hot paths, use primitive arrays (IntArray, LongArray …) and @JvmInline value classes instead of boxed values, primitive collections (androidx.collection, fastutil) instead of boxed ones, and presize collections and StringBuilders.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader1.7 / 10Critical✓ Tool-verified
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
`stringCount` is read from the bytes being parsed at line 2001 (`int`), then used to size a `IntArray` at line 2009 — and nowhere in its scope is `stringCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringCount` against the bytes actually remaining and a maximum the format allows before allocating. — app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2009
`styleCount` is read from the bytes being parsed at line 2002 (`int`), then used to size a `IntArray` at line 2011 — and nowhere in its scope is `styleCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `styleCount` against the bytes actually remaining and a maximum the format allows before allocating. — app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2011
`stringCount` is read from the bytes being parsed at line 57 (`int`), then used to size a `IntArray` at line 71 — and nowhere in its scope is `stringCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringCount` against the bytes actually remaining and a maximum the format allows before allocating. — app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:71
`strCount` is read from the bytes being parsed at line 475 (`int`), then used to size a `IntArray` at line 484 — and nowhere in its scope is `strCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `strCount` against the bytes actually remaining and a maximum the format allows before allocating. — app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:484
`stringCount` is read from the bytes being parsed at line 483 (`int`), then used to size a `IntArray` at line 490 — and nowhere in its scope is `stringCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringCount` against the bytes actually remaining and a maximum the format allows before allocating. — app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:490
`styleCount` is read from the bytes being parsed at line 484 (`int`), then used to size a `IntArray` at line 491 — and nowhere in its scope is `styleCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `styleCount` against the bytes actually remaining and a maximum the format allows before allocating. — app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:491
What to do
Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document3.5 / 10Weak✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`Converters.mergeMissingDefaults` is public and takes `defaults: JsonElement` from its caller, and it calls itself at line 155 with a piece of `defaults` — the function is not `tailrec`, so every call is a real frame — and nowhere in `Converters.mergeMissingDefaults` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `Converters.mergeMissingDefaults` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — app/src/main/java/com/webtoapp/data/converter/Converters.kt:155
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether 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/19 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.
`downloadFilterText` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:1519
`importHostsFromUrl` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:2318
`generate` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. (×2) — app/src/main/java/com/webtoapp/core/agent/imagery/OpenAiImageGenerator.kt:39, app/src/main/java/com/webtoapp/core/agent/imagery/GeminiImageGenerator.kt:35
`testConnection` 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/webtoapp/core/ai/AiApiClient.kt:49
`fetchModels` 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/webtoapp/core/ai/AiApiClient.kt:151
`downloadFileEx` suspends, but makes its request with `call.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/webtoapp/core/download/DependencyDownloadEngine.kt:201
`preloadRequires` 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/webtoapp/core/extension/ExtensionFileManager.kt:376
`preloadResources` 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/webtoapp/core/extension/ExtensionFileManager.kt:410
`downloadFile` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/webtoapp/core/linux/NativeNodeEngine.kt:223
`fetchScripts` 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/webtoapp/core/market/GreasyForkSearch.kt:126
`fetchScriptCode` 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/webtoapp/core/market/GreasyForkSearch.kt:165
`search` 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/webtoapp/core/market/ChromeWebStoreSearch.kt:71
`fetchDetails` 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/webtoapp/core/market/ChromeWebStoreSearch.kt:157
`checkUrl` 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/webtoapp/core/stats/AppHealthMonitor.kt:46
`downloadPacScript` 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/webtoapp/core/webview/PacProxyManager.kt:373
`fetch` 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/webtoapp/util/UrlMetadataFetcher.kt:62
`saveFromUrl` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/webtoapp/util/MediaSaver.kt:76
`saveFromUrlWithHeaders` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/webtoapp/util/MediaSaver.kt:122
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 an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
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.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
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.
`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. (×20) — app/src/main/java/com/webtoapp/WebToAppApplication.kt:222, app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:1527, app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:2671, …
`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. (×9) — app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt:380, app/src/main/java/com/webtoapp/core/activation/ActivationCode.kt:60, app/src/main/java/com/webtoapp/core/agent/files/ProjectFileManager.kt:114, …
`catch (e: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:2733
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. (×10) — app/src/main/java/com/webtoapp/core/agent/engine/AbortController.kt:14, app/src/main/java/com/webtoapp/core/agent/llm/OllamaProvider.kt:48, app/src/main/java/com/webtoapp/core/agent/llm/GeminiProvider.kt:63, …
What to do
Swallowed exception (caught, then discarded)
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 — 4 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 53 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — 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
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the Android app did not build — `./gradlew :app:assembleDebug` exited 1: ot in 'org.gradle' namespace)
- Included Builds (No included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.android:org.jetbrains.kotlin.and…; 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 — ~31149 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
D14 License Compliance — Not scored — this repository's 79 declared JVM dependency coordinate(s) were read from its 5 Maven/Gradle manifest(s), but Maven Central could not be asked for the licence of 47 of them (HTTP 429 Too Many Requests from https://repo1.maven.org/maven2/androidx/core/core-ktx/1.12.0/core-ktx-1.12.0.pom), and a licence verdict over part of a dependency graph is not a licence verdict. Nothing is asserted about this repository's licensing in either direction.
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.
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+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.kt), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 49 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
D9 Test Distribution — Test source is 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 its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
DM1 Domain Modelling — applicable but not scored (3 signals for this style, 2 needed — the count is met but a required primary signal is absent): 658 value object(s); 8 domain event(s); its domain events are published by services or handlers — no domain entity raises one; 3 repository port(s) loading or saving an aggregate/entity; a domain structure with no aggregate, domain event or strongly-typed id in it: a CRUD / clean-architecture model, measured but not claimed as DDD; a top-level examples/ tree: a library or framework whose examples are its consumers — these types are building blocks, not a domain
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 and Scala, 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'.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (JaCoCo XML — the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
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.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's 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: AppDatabase.webAppDao app/src/main/java/com/webtoapp/data/database/AppDatabase.kt:28— MethodTooLong — webAppDao runs 1113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1013 over it, 11.13× 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: AppDatabase.appCategoryDao app/src/main/java/com/webtoapp/data/database/AppDatabase.kt:29— MethodTooLong — appCategoryDao runs 1112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1012 over it, 11.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AppDatabase.appUsageStatsDao app/src/main/java/com/webtoapp/data/database/AppDatabase.kt:30— MethodTooLong — appUsageStatsDao runs 1111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1011 over it, 11.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BuildApkScreenKt.BuildApkContent app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.kt:136— MethodTooLong — BuildApkContent runs 725 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 625 over it, 7.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CreateAppWebViewCardsKt.SpecialSettingsCard app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:3414— MethodTooLong — SpecialSettingsCard runs 696 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 596 over it, 6.96× 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: CreateAppWebViewCardsKt.BrowserAdvancedConfigCard app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:928— MethodTooLong — BrowserAdvancedConfigCard runs 660 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 560 over it, 6.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AppNavigationKt.AppNavigation app/src/main/java/com/webtoapp/ui/navigation/AppNavigation.kt:156— MethodTooLong — AppNavigation runs 480 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 380 over it, 4.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: OnlineMusicSearchDialogKt.OnlineMusicSearchDialog app/src/main/java/com/webtoapp/ui/components/OnlineMusicSearchDialog.kt:72— MethodTooLong — OnlineMusicSearchDialog runs 453 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 353 over it, 4.53× 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: Companion.getInjectionScript app/src/main/java/com/webtoapp/core/webview/MediaSessionBridge.kt:263— MethodTooLong — getInjectionScript runs 393 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 293 over it, 3.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BgmSelectorKt.BgmSelectorDialog app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:53— MethodTooLong — BgmSelectorDialog runs 376 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 276 over it, 3.76× 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: WtaCodeEditorDialogKt.WtaCodeEditorDialog app/src/main/java/com/webtoapp/ui/components/WtaCodeEditorDialog.kt:71— MethodTooLong — WtaCodeEditorDialog runs 368 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 268 over it, 3.68× 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: CreateMultiWebAppScreenKt.CreateMultiWebAppScreen app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt:64— MethodTooLong — CreateMultiWebAppScreen runs 351 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 251 over it, 3.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CreateMediaAppScreenKt.CreateMediaAppScreen app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:46— MethodTooLong — CreateMediaAppScreen runs 344 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 244 over it, 3.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CreateGoAppScreenKt.CreateGoAppScreen app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:48— MethodTooLong — CreateGoAppScreen runs 342 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 242 over it, 3.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: CreateOfflinePackScreenKt.CreateOfflinePackScreen app/src/main/java/com/webtoapp/ui/screens/CreateOfflinePackScreen.kt:29— MethodTooLong — CreateOfflinePackScreen runs 341 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 241 over it, 3.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: ShellActivity.onCreate app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:489— MethodTooLong — onCreate runs 336 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 236 over it, 3.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CreateAppScreenKt.CreateAppScreen app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:72— MethodTooLong — CreateAppScreen runs 334 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 234 over it, 3.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: HostsAdBlockScreenKt.HostsAdBlockScreen app/src/main/java/com/webtoapp/ui/screens/HostsAdBlockScreen.kt:93— MethodTooLong — HostsAdBlockScreen runs 334 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 234 over it, 3.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GeckoViewEngine.setupPromptDelegate app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1013— MethodTooLong — setupPromptDelegate runs 320 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 220 over it, 3.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: ShellTranslateScriptKt.injectTranslateScript app/src/main/java/com/webtoapp/ui/shell/ShellTranslateScript.kt:3— MethodTooLong — injectTranslateScript runs 308 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 208 over it, 3.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: ShellWebViewConfigKt.buildWebViewConfig app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.kt:8— MethodTooLong — buildWebViewConfig runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AutoStartCardKt.AutoStartCard app/src/main/java/com/webtoapp/ui/components/AutoStartCard.kt:36— MethodTooLong — AutoStartCard runs 299 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 199 over it, 2.99× 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: BrowserDisguiseConfigCardKt.BrowserDisguiseConfigCard app/src/main/java/com/webtoapp/ui/components/BrowserDisguiseConfigCard.kt:34— MethodTooLong — BrowserDisguiseConfigCard runs 290 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 190 over it, 2.90× 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: CreateAppApkSectionKt.CustomSigningSection app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.kt:721— MethodTooLong — CustomSigningSection runs 288 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 188 over it, 2.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ManualLrcAlignerKt.ManualLrcAlignerDialog app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:45— MethodTooLong — ManualLrcAlignerDialog runs 287 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 187 over it, 2.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:1618— app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt changed 86 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 424 in WebViewActivityKt.WebViewScreen at line 1618. 47 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.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/webtoapp/core/webview/WebViewManager.kt app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:2267— app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt changed 61 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 224 in WebViewManager.createWebViewClient at line 2267. 35 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/webview/WebViewManager.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/webtoapp/core/apkbuilder/ApkBuilder.kt app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1441— app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt changed 87 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 99 in ApkBuilder.modifyApk at line 1441. 30 of those changes were fix/bug commits, and the other 57 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.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/webtoapp/ui/shell/ShellScreen.kt app/src/main/java/com/webtoapp/ui/shell/ShellScreen.kt:50— app/src/main/java/com/webtoapp/ui/shell/ShellScreen.kt changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 114 in ShellScreenKt.ShellScreen at line 50. 14 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/shell/ShellScreen.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/webtoapp/data/model/WebApp.kt app/src/main/java/com/webtoapp/data/model/WebApp.kt:1506— app/src/main/java/com/webtoapp/data/model/WebApp.kt changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in ApkRuntimePermissions.manualBeyond at line 1506. 21 of those changes were fix/bug commits, and the other 53 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/data/model/WebApp.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/webtoapp/ui/shell/ShellActivity.kt app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:489— app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in ShellActivity.onCreate at line 489. 27 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/shell/ShellActivity.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/webtoapp/ui/screens/BuildApkScreen.kt app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.kt:136— app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.kt changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in BuildApkScreenKt.BuildApkContent at line 136. 9 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.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/webtoapp/ui/shell/MultiWebShellMode.kt app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt:245— app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in MultiWebShellModeKt.TabsMode at line 245. 11 of those changes were fix/bug commits, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.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/webtoapp/ui/screens/HomeScreen.kt app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:118— app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in HomeScreenKt.HomeScreen at line 118. 3 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1013— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in GeckoViewEngine.setupPromptDelegate at line 1013. 22 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.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/webtoapp/core/agent/engine/AgentEngine.kt app/src/main/java/com/webtoapp/core/agent/engine/AgentEngine.kt:50— app/src/main/java/com/webtoapp/core/agent/engine/AgentEngine.kt changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in AgentEngine.run at line 50. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/agent/engine/AgentEngine.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/webtoapp/ui/shell/ShellWebViewConfig.kt app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.kt:8— app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.kt changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in ShellWebViewConfigKt.buildWebViewConfig at line 8. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.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/webtoapp/ui/agent/AgentViewModel.kt app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt:1800— app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in AgentViewModel.handleAgentEvent at line 1800. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.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/webtoapp/ui/screens/CreateHtmlAppScreen.kt app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:94— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 125 in CreateHtmlAppScreenKt.CreateHtmlAppScreen at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.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/webtoapp/ui/screens/CreateAppWebViewCards.kt app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:928— app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in CreateAppWebViewCardsKt.BrowserAdvancedConfigCard at line 928. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.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/webtoapp/ui/screens/CreateAppScreen.kt app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:838— app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in CreateAppScreenKt.BasicInfoCard at line 838. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.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/webtoapp/ui/shell/ShellScaffoldLayout.kt app/src/main/java/com/webtoapp/ui/shell/ShellScaffoldLayout.kt:41— app/src/main/java/com/webtoapp/ui/shell/ShellScaffoldLayout.kt changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in ShellScaffoldLayoutKt.ShellScaffoldLayout at line 41. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/shell/ShellScaffoldLayout.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/webtoapp/core/apkbuilder/ApkBuildCache.kt app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuildCache.kt:292— app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuildCache.kt changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in ApkBuildCache.isContentReplaceableEntry at line 292. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuildCache.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/webtoapp/ui/agent/components/MessageBubbles.kt app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:938— app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in MessageBubblesKt.SpecialToolBody at line 938. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.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/webtoapp/core/webview/NativeBridge.kt app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:1447— app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in NativeBridge.httpRequest at line 1447. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/webview/NativeBridge.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/webtoapp/ui/screens/CreatePythonAppScreen.kt app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:49— app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in CreatePythonAppScreenKt.CreatePythonAppScreen at line 49. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.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/webtoapp/core/agent/runtime/AgentService.kt app/src/main/java/com/webtoapp/core/agent/runtime/AgentService.kt:206— app/src/main/java/com/webtoapp/core/agent/runtime/AgentService.kt changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in AgentService.persistEvent at line 206. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/agent/runtime/AgentService.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/webtoapp/ui/screens/CreateMultiWebAppScreen.kt app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt:64— app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in CreateMultiWebAppScreenKt.CreateMultiWebAppScreen at line 64. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.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/webtoapp/ui/shell/ShellWebViewCallbacks.kt app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.kt:31— app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.kt changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in ShellWebViewCallbacksKt.createShellWebViewCallbacks at line 31. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.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/webtoapp/ui/screens/CreateAppApkSection.kt app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.kt:721— app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.kt changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in CreateAppApkSectionKt.CustomSigningSection at line 721. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.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: i18n/Strings.kt app/src/main/java/com/webtoapp/core/i18n/Strings.kt— FileTooLong — 5262 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4762 over it, 10.52× 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: webview/WebViewManager.kt app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt— FileTooLong — 4615 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4115 over it, 9.23× 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: apkbuilder/ApkBuilder.kt app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt— FileTooLong — 3852 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: ApkBuilder (61-4067). The bar is 500 significant lines; this is 3352 over it, 7.70× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: screens/CreateAppWebViewCards.kt app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt— FileTooLong — 3455 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2955 over it, 6.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: webview/WebViewActivity.kt app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt— FileTooLong — 3276 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2776 over it, 6.55× 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: adblock/AdBlocker.kt app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt— FileTooLong — 1880 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: AdBlocker (22-2680). The bar is 500 significant lines; this is 1380 over it, 3.76× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: screens/CreateHtmlAppScreen.kt app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt— FileTooLong — 1810 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1310 over it, 3.62× 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: ai/AiApiClient.kt app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt— FileTooLong — 1759 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: AiApiClient (23-2483). The bar is 500 significant lines; this is 1259 over it, 3.52× 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: webview/NativeBridge.kt app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt— FileTooLong — 1756 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: NativeBridge (59-2415). The bar is 500 significant lines; this is 1256 over it, 3.51× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: screens/AboutScreen.kt app/src/main/java/com/webtoapp/ui/screens/AboutScreen.kt— FileTooLong — 1733 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1233 over it, 3.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: engine/GeckoViewEngine.kt app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt— FileTooLong — 1682 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: GeckoViewEngine (46-2488). The bar is 500 significant lines; this is 1182 over it, 3.36× 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: apkbuilder/AxmlRebuilder.kt app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt— FileTooLong — 1678 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: AxmlRebuilder (8-2506). The bar is 500 significant lines; this is 1178 over it, 3.36× 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: agent/AgentViewModel.kt app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt— FileTooLong — 1581 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: AgentViewModel (57-2330). The bar is 500 significant lines; this is 1081 over it, 3.16× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: screens/CreateGalleryAppScreen.kt app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt— FileTooLong — 1378 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 878 over it, 2.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: screens/HomeScreen.kt app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt— FileTooLong — 1354 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 854 over it, 2.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: screens/BuildApkScreen.kt app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.kt— FileTooLong — 1319 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 819 over it, 2.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: shell/ShellModeManager.kt app/src/main/java/com/webtoapp/core/shell/ShellModeManager.kt— FileTooLong — 1313 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 813 over it, 2.63× 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: model/WebApp.kt app/src/main/java/com/webtoapp/data/model/WebApp.kt— FileTooLong — 1288 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 788 over it, 2.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/ActivationCodeCard.kt app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt— FileTooLong — 1206 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 706 over it, 2.41× 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: shell/MultiWebShellMode.kt app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt— FileTooLong — 1199 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 699 over it, 2.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: screens/CreateAppApkSection.kt app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.kt— FileTooLong — 1189 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 689 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: screens/AiSettingsScreen.kt app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt— FileTooLong — 1183 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 683 over it, 2.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: viewmodel/MainViewModel.kt app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt— FileTooLong — 1173 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: MainViewModel (41-1657). The bar is 500 significant lines; this is 673 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: database/AppDatabase.kt app/src/main/java/com/webtoapp/data/database/AppDatabase.kt— FileTooLong — 1147 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: AppDatabase (26-1320). The bar is 500 significant lines; this is 647 over it, 2.29× 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: components/MessageBubbles.kt app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt— FileTooLong — 1143 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 643 over it, 2.29× 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.
Duplicated block (12 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:720— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:720-731 | app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:29-40 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:739— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:739-750 | app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:48-59 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:739` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:853— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:853-864 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:913-924 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:853` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:850` calls `get`, `getAsJsonObject`, `getAsJsonArray` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:912` 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/webtoapp/core/ai/AiApiClient.kt:847— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:847-858 | app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:13-24 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt` as WHOLE FILES: this scan already matched 7 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/ai/AiApiClient.kt:847` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:951— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:951-962 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1033-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/webtoapp/core/ai/AiApiClient.kt:951` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1603— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1603-1614 | app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:67-78 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt` as WHOLE FILES: this scan already matched 7 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/ai/AiApiClient.kt:1603` it does not close everything it opens, so those 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/webtoapp/core/ai/provider/AiResponseParser.kt:81` calls `Suppress` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1617` 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/webtoapp/core/ai/provider/AiResponseParser.kt:19— app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:19-30 | app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:36-47 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/provider/AiResponseParser.kt:19` 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/webtoapp/core/ai/provider/AiResponseParser.kt:16` calls `get`, `getAsJsonObject`, `getAsJsonArray` and `app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:35` 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/webtoapp/core/engine/GeckoViewEngine.kt:1202— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1202-1213 | app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3326-3337 — 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/webtoapp/core/engine/GeckoViewEngine.kt:1202` 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/webtoapp/core/engine/GeckoViewEngine.kt:1200` calls `setText` and `app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3324` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1415— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1415-1426 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1450-1461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/engine/GeckoViewEngine.kt:1415` 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/webtoapp/core/i18n/RandomAppNameGenerator.kt:139— app/src/main/java/com/webtoapp/core/i18n/RandomAppNameGenerator.kt:139-150 | app/src/main/java/com/webtoapp/core/i18n/RandomAppNameGenerator.kt:154-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/i18n/RandomAppNameGenerator.kt:139` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/java/com/webtoapp/core/i18n/StringsE.kt:15026— app/src/main/java/com/webtoapp/core/i18n/StringsE.kt:15026-15037 | app/src/main/java/com/webtoapp/core/i18n/StringsE.kt:15143-15154 — both copies are in the same file, so extract the 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/webtoapp/core/playstore/aab/arsc/ArscReader.kt:413— app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscReader.kt:413-424 | app/src/main/java/com/webtoapp/core/playstore/aab/axml/AxmlReader.kt:317-328 — 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 (12 lines × 2) app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscToProtoTable.kt:207— app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscToProtoTable.kt:207-218 | app/src/main/java/com/webtoapp/core/playstore/aab/axml/AxmlToProtoXml.kt:115-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/webtoapp/core/playstore/aab/arsc/ArscToProtoTable.kt:207` it begins part-way through the construct above it, so those exact lines 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/webtoapp/core/port/PortManager.kt:304— app/src/main/java/com/webtoapp/core/port/PortManager.kt:304-315 | app/src/main/java/com/webtoapp/core/port/PortManager.kt:344-355 — both copies are in the same file, so extract the 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/webtoapp/ui/agent/components/MessageBubbles.kt:480— app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:480-491 | app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:495-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/webtoapp/ui/agent/components/MessageBubbles.kt:480` 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/webtoapp/ui/components/BgmSelector.kt:1440— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1440-1451 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:889-900 — 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/webtoapp/ui/components/BgmSelector.kt:1440` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/components/LongPressMenu.kt:147— app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:147-158 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:215-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/LongPressMenu.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 (12 lines × 2) app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:347— app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:347-358 | app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:483-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/NotificationConfigCard.kt:347` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:240— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:240-251 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:315-326 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:240` it does not close everything it opens, so those exact lines 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:1046— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:1046-1057 | app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:1349-1361 — 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:1046` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/screens/AiSettingsScreen.kt:1451— app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:1451-1462 | app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:1608-1619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/AiSettingsScreen.kt:1451` it does not close everything it opens, so those 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/webtoapp/ui/screens/AiSettingsScreen.kt:1463` calls `isNotEmpty`, `firstOrNull` and `app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:1620` 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/webtoapp/ui/screens/ConfigTemplateMenuButton.kt:282— app/src/main/java/com/webtoapp/ui/screens/ConfigTemplateMenuButton.kt:282-293 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:680-691 — 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/webtoapp/ui/screens/ConfigTemplateMenuButton.kt:282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateAppUserScripts.kt:367— app/src/main/java/com/webtoapp/ui/screens/CreateAppUserScripts.kt:367-378 | app/src/main/java/com/webtoapp/ui/screens/CreateAppUserScripts.kt:418-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:511— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:511-522 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:625-636 — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:511` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:642— app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:642-653 | app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:540-551 — 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/webtoapp/ui/screens/CreatePhpAppScreen.kt:642` 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.
Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/WebToAppApplication.kt:222— `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/webtoapp/core/activation/ActivationManager.kt:380— `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/webtoapp/core/activation/ActivationCode.kt:60— `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/webtoapp/core/adblock/AdBlocker.kt:1527— `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/webtoapp/core/adblock/AdBlocker.kt:2671— `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/webtoapp/core/adblock/AdBlocker.kt:2674— `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/webtoapp/core/adblock/AdBlocker.kt:2733— `catch (e: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/webtoapp/core/agent/files/ProjectFileManager.kt:114— `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/webtoapp/core/agent/files/ProjectFileManager.kt:200— `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/webtoapp/core/agent/mcp/LoopbackHttpServer.kt:42— `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/webtoapp/core/agent/mcp/HostMcpController.kt:148— `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/webtoapp/core/agent/tool/builtin/PreviewScript.kt:61— `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/webtoapp/core/ai/AiConfigManager.kt:302— `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/webtoapp/core/ai/AiConfigManager.kt:383— `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/webtoapp/core/ai/AiConfigManager.kt:389— `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/webtoapp/core/ai/AiApiClient.kt:605— `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/webtoapp/core/apkbuilder/ShellTemplateProvider.kt:29— `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/webtoapp/core/apkbuilder/ShellTemplateProvider.kt:76— `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/webtoapp/core/apkbuilder/ElfAligner16k.kt:115— `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/webtoapp/core/apkbuilder/ElfAligner16k.kt:130— `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/webtoapp/core/apkbuilder/ApkTemplate.kt:121— `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/webtoapp/core/apkbuilder/ApkTemplate.kt:158— `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/webtoapp/core/apkbuilder/ApkTemplate.kt:204— `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/webtoapp/core/apkbuilder/ApkBuilder.kt:218— `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/webtoapp/core/apkbuilder/ApkBuilder.kt:2631— `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 (11 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:353— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:353-363 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:382-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:353` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:866— app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:866-876 | app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1178-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.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlEditor.kt:85— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlEditor.kt:85-95 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlEditor.kt:100-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/apkbuilder/AxmlEditor.kt:85` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1733— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1733-1743 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1775-1785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/engine/GeckoViewEngine.kt:1733` 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/webtoapp/core/linux/LinuxEnvironmentManager.kt:266— app/src/main/java/com/webtoapp/core/linux/LinuxEnvironmentManager.kt:266-276 | app/src/main/java/com/webtoapp/core/linux/LinuxEnvironmentManager.kt:288-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/linux/LinuxEnvironmentManager.kt:266` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:185— app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:185-198 | app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:221-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:185` it does not close everything it opens, so those 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/webtoapp/core/webview/DownloadBridge.kt:929— app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:929-939 | app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:1017-1027 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:929` 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/webtoapp/core/webview/WebViewManager.kt:2986— app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:2986-2996 | app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3088-3098 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/webview/WebViewManager.kt:2986` it does not close everything it opens, so those exact lines 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/webtoapp/ui/agent/components/MarkdownText.kt:342— app/src/main/java/com/webtoapp/ui/agent/components/MarkdownText.kt:342-352 | app/src/main/java/com/webtoapp/ui/agent/components/MarkdownText.kt:452-462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/agent/components/MarkdownText.kt:342` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:558— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:558-568 | app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:592-602 — both copies are in the same file, so extract the 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/webtoapp/ui/components/PluginPickerCard.kt:201— app/src/main/java/com/webtoapp/ui/components/PluginPickerCard.kt:201-212 | app/src/main/java/com/webtoapp/ui/screens/PluginManagerScreen.kt:558-568 — 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/webtoapp/ui/components/PluginPickerCard.kt:201` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/components/SampleProjectCard.kt:306— app/src/main/java/com/webtoapp/ui/components/SampleProjectCard.kt:306-316 | app/src/main/java/com/webtoapp/ui/components/TypedSampleProjectCard.kt:134-144 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/SampleProjectCard.kt` and `app/src/main/java/com/webtoapp/ui/components/TypedSampleProjectCard.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:770— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:770-780 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:782-793 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:770` 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/webtoapp/ui/screens/CreateGalleryAppScreen.kt:746— app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:746-756 | app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:915-925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateGalleryAppScreen.kt:746` it does not close everything it opens, so those exact lines 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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1423— app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1423-1433 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1492-1502 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1423` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/ui/screens/PlayStoreScreen.kt:423— app/src/main/java/com/webtoapp/ui/screens/PlayStoreScreen.kt:423-433 | app/src/main/java/com/webtoapp/ui/screens/StatsScreen.kt:553-563 — 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/webtoapp/ui/screens/PlayStoreScreen.kt:423` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/ui/shared/WindowHelper.kt:186— app/src/main/java/com/webtoapp/ui/shared/WindowHelper.kt:186-196 | app/src/main/java/com/webtoapp/ui/shared/WindowHelper.kt:259-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/shared/WindowHelper.kt:186` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/shell/MultiWebShellMode.kt:84— app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt:84-94 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:4008-4018 — 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/webtoapp/ui/shell/MultiWebShellMode.kt:84` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:2474— app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:2474-2484 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:2665-2675 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/webview/WebViewActivity.kt:2474` it does not close everything it opens, so those 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/webtoapp/ui/webview/WebViewActivity.kt:2663` calls `getProjectDir` and `app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:2472` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:819— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:819-829 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:797-808 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt` and `app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/screens/CreateGoAppScreen.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.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/core/frontend/ProjectDetector.kt:455— app/src/main/java/com/webtoapp/core/frontend/ProjectDetector.kt:455-465 | app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:157-167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:958— app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:958-968 | app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:1005-1015 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/agent/components/MessageBubbles.kt:958` 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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1215— app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1215-1225 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1407-1417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1215` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:178— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:178-188 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:132-142 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/php/PhpAppRuntime.kt:178` it does not close everything it opens, so those exact lines 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/webtoapp/core/golang/GoRuntime.kt:443— app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:443-453 | app/src/main/java/com/webtoapp/core/nodejs/NodeService.kt:487-497 — 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/webtoapp/core/golang/GoRuntime.kt:443` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
TooManyMethods: WebViewManager app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:48— TooManyMethods — 110 methods. The bar is 30 methods; this is 80 over it, 3.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AgentViewModel app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt:57— TooManyMethods — 99 methods. The bar is 30 methods; this is 69 over it, 3.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: AdBlocker app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:22— TooManyMethods — 93 methods. The bar is 30 methods; this is 63 over it, 3.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NativeBridge app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:59— TooManyMethods — 89 methods. The bar is 30 methods; this is 59 over it, 2.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ApkBuilder app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:61— TooManyMethods — 82 methods. The bar is 30 methods; this is 52 over it, 2.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MainViewModel app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:41— TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AxmlRebuilder app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:8— TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Strings app/src/main/java/com/webtoapp/core/i18n/Strings.kt:7— TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LocalBuildEnvironment app/src/main/java/com/webtoapp/core/linux/LocalBuildEnvironment.kt:27— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.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.
TooManyMethods: ContentExtensionBridge app/src/main/java/com/webtoapp/core/extension/ChromeExtensionRuntime.kt:476— 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: WebViewActivity app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:120— 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: PythonDependencyManager REDACTED:20— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ShellActivity app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:37— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AiApiClient app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:23— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: JarSigner app/src/main/java/com/webtoapp/core/apkbuilder/JarSigner.kt:21— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FloatingWindowManager app/src/main/java/com/webtoapp/core/floatingwindow/FloatingWindowManager.kt:32— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 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.
TooManyMethods: Converters app/src/main/java/com/webtoapp/data/converter/Converters.kt:37— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 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.
TooManyMethods: NodeDependencyManager app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:23— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AppLogger app/src/main/java/com/webtoapp/core/logging/AppLogger.kt:22— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GeckoViewEngine app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:46— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PortManager app/src/main/java/com/webtoapp/core/port/PortManager.kt:13— 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: BackgroundBridge app/src/main/java/com/webtoapp/core/extension/ChromeExtensionRuntime.kt:245— TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PluginStore app/src/main/java/com/webtoapp/core/plugin/PluginStore.kt:48— TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ActivationManager app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt:22— 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: DeclarativeNetRequestEngine app/src/main/java/com/webtoapp/core/extension/DeclarativeNetRequestEngine.kt:9— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (13 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:877— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:877-889 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1431-1443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:877` it does not close everything it opens, so those 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/webtoapp/core/ai/AiApiClient.kt:1444` calls `addProperty` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:890` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:937— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:937-949 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1019-1031 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:937` 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/webtoapp/core/ai/AiApiClient.kt:971— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:971-983 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1502-1514 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:971` it does not close everything it opens, so those exact lines 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/webtoapp/core/ai/AiApiClient.kt:2446— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2446-2458 | app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:91-103 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/ZipUtils.kt:21— app/src/main/java/com/webtoapp/core/apkbuilder/ZipUtils.kt:21-33 | app/src/main/java/com/webtoapp/core/crypto/EncryptedApkBuilder.kt:181-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. 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/webtoapp/core/appmodifier/AppCloner.kt:68— app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:68-80 | app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:232-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:634— app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:634-646 | app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:659-671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/appmodifier/AppCloner.kt:634` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13 lines × 2) app/src/main/java/com/webtoapp/core/frontend/SampleProjectManager.kt:15— app/src/main/java/com/webtoapp/core/frontend/SampleProjectManager.kt:15-27 | app/src/main/java/com/webtoapp/core/sample/SampleProjectExtractor.kt:33-45 — 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 (13 lines × 2) app/src/main/java/com/webtoapp/ui/agent/components/AppChangesReviewCard.kt:80— app/src/main/java/com/webtoapp/ui/agent/components/AppChangesReviewCard.kt:80-92 | app/src/main/java/com/webtoapp/ui/agent/components/ChangesReviewCard.kt:86-98 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/agent/components/AppChangesReviewCard.kt` and `app/src/main/java/com/webtoapp/ui/agent/components/ChangesReviewCard.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/agent/components/AppChangesReviewCard.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 (13 lines × 2) app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:463— app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:463-475 | app/src/main/java/com/webtoapp/ui/shell/ConsolePanel.kt:83-95 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt` and `app/src/main/java/com/webtoapp/ui/shell/ConsolePanel.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:463` 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/webtoapp/ui/components/BgmSelector.kt:624— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:624-636 | app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:718-730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:624` it does not close everything it opens, so those exact lines 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/webtoapp/ui/components/BgmSelector.kt:1488— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1488-1500 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:618-630 — 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/webtoapp/ui/components/BgmSelector.kt:1488` 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/webtoapp/ui/components/BgmSelector.kt:1532— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1532-1544 | app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:387-399 — 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/webtoapp/ui/components/BgmSelector.kt:1532` 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/webtoapp/ui/components/DataBackupDialog.kt:281— app/src/main/java/com/webtoapp/ui/components/DataBackupDialog.kt:281-293 | app/src/main/java/com/webtoapp/ui/components/DataBackupDialog.kt:328-340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/DataBackupDialog.kt:281` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/components/LongPressMenu.kt:727— app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:727-739 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:1184-1196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:347— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:347-359 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:260-272 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:347` 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/webtoapp/ui/screens/CreateAppWebViewCards.kt:1557— app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:1557-1569 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:1612-1624 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateAppWebViewCards.kt:1557` 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/webtoapp/ui/screens/CreateAppWebViewCards.kt:1573— app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:1573-1585 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:1628-1640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:1573` 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/webtoapp/ui/screens/CreateAppWebViewCards.kt:4584— app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:4584-4596 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:4706-4718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateAppWebViewCards.kt:4584` it does not close everything it opens, so those exact lines 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:535— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:535-547 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:575-587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:535` it does not close everything it opens, so those exact lines 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/webtoapp/ui/screens/LinuxEnvironmentScreen.kt:1182— app/src/main/java/com/webtoapp/ui/screens/LinuxEnvironmentScreen.kt:1182-1194 | app/src/main/java/com/webtoapp/ui/screens/LinuxEnvironmentScreen.kt:1211-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. 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/webtoapp/util/IconStorage.kt:175— app/src/main/java/com/webtoapp/util/IconStorage.kt:175-187 | app/src/main/java/com/webtoapp/util/SplashStorage.kt:198-210 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt:126— app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt:126-138 | app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt:152-164 — both copies are in the same file, so extract the 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/webtoapp/core/activation/ActivationManager.kt:141` calls `fromJson`, `fromLegacyString` and `app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt:165` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:1381— app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:1381-1393 | app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:1510-1522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/HomeScreen.kt:1510` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/src/main/java/com/webtoapp/core/agent/imagery/GeminiImageGenerator.kt:72— app/src/main/java/com/webtoapp/core/agent/imagery/GeminiImageGenerator.kt:72-80 | app/src/main/java/com/webtoapp/core/agent/imagery/OpenAiImageGenerator.kt:73-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. The matched lines also transfer control out of the body holding them, which cannot 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/webtoapp/core/ai/AiApiClient.kt:910— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:910-918 | app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:33-41 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt` as WHOLE FILES: this scan already matched 7 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/ai/AiApiClient.kt:910` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt:175— app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt:175-183 | app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt:244-252 — both copies are in the same file, so extract the 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/webtoapp/core/apkbuilder/JarSigner.kt:334— app/src/main/java/com/webtoapp/core/apkbuilder/JarSigner.kt:334-342 | app/src/main/java/com/webtoapp/core/apkbuilder/JarSigner.kt:636-644 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/apkbuilder/JarSigner.kt:334` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:406— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:406-414 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:361-369 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (9 lines × 2) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:189— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:189-197 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:143-151 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/php/PhpAppRuntime.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 (9 lines × 2) app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:679— app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:679-687 | app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:705-713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/webview/NativeBridge.kt:679` it does not close everything it opens, so those 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/webtoapp/core/webview/NativeBridge.kt:702` calls `split`, `trim`, `toLongOrNull` and `app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:678` 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/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:802— app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:802-810 | app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:918-926 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:802` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/components/NodeExtensionsCard.kt:105— app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt:105-113 | app/src/main/java/com/webtoapp/ui/components/PythonExtensionsCard.kt:105-113 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt` and `app/src/main/java/com/webtoapp/ui/components/PythonExtensionsCard.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/components/NodeExtensionsCard.kt:105` 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/webtoapp/ui/components/PhpExtensionsCard.kt:50— app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt:50-58 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:891-899 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt` and `app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt:50` it does not close everything it opens, so those exact lines 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/webtoapp/ui/components/PluginPickerCard.kt:81— app/src/main/java/com/webtoapp/ui/components/PluginPickerCard.kt:81-89 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:483-491 — 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/webtoapp/ui/components/PluginPickerCard.kt:81` 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/webtoapp/ui/components/RuntimeScreenComponents.kt:216— app/src/main/java/com/webtoapp/ui/components/RuntimeScreenComponents.kt:216-224 | app/src/main/java/com/webtoapp/ui/components/RuntimeScreenComponents.kt:345-353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/RuntimeScreenComponents.kt:216` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/src/main/java/com/webtoapp/ui/screens/AboutScreen.kt:434— app/src/main/java/com/webtoapp/ui/screens/AboutScreen.kt:434-442 | app/src/main/java/com/webtoapp/ui/screens/AboutScreen.kt:469-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/webtoapp/ui/screens/AboutScreen.kt:434` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:1514— app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:1514-1522 | app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.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. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:1514` 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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:192— app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:192-200 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:550-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/src/main/java/com/webtoapp/ui/screens/FileManagerScreen.kt:1097— app/src/main/java/com/webtoapp/ui/screens/FileManagerScreen.kt:1097-1105 | app/src/main/java/com/webtoapp/ui/screens/FileManagerScreen.kt:1124-1132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/FileManagerScreen.kt:1097` 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 (9 lines × 2) app/src/main/java/com/webtoapp/ui/screens/RuntimeDepsScreen.kt:537— app/src/main/java/com/webtoapp/ui/screens/RuntimeDepsScreen.kt:537-545 | app/src/main/java/com/webtoapp/ui/screens/RuntimeDepsScreen.kt:552-560 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/RuntimeDepsScreen.kt:537` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/ui/screens/RuntimeDepsScreen.kt:547` calls `isNotEmpty` and `app/src/main/java/com/webtoapp/ui/screens/RuntimeDepsScreen.kt:562` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.kt:70— app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.kt:70-78 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3308-3316 — 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/webtoapp/ui/shell/ShellWebViewCallbacks.kt:70` it does not close everything it opens, so those exact lines 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/webtoapp/ui/theme/ThemeAnimations.kt:541— app/src/main/java/com/webtoapp/ui/theme/ThemeAnimations.kt:541-549 | app/src/main/java/com/webtoapp/ui/theme/ThemeAnimations.kt:555-563 — both copies are in the same file, so extract the 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/webtoapp/util/DownloadNotificationManager.kt:322— app/src/main/java/com/webtoapp/util/DownloadNotificationManager.kt:322-330 | app/src/main/java/com/webtoapp/util/DownloadNotificationManager.kt:343-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/util/DownloadNotificationManager.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. The matched lines also transfer control out of the body holding them, which cannot 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/webtoapp/core/startup/AppStartupManager.kt:35— app/src/main/java/com/webtoapp/core/startup/AppStartupManager.kt:35-43 | shell/src/main/java-overrides/com/webtoapp/WebToAppApplication.kt:111-119 — 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/webtoapp/ui/shell/ShellActivity.kt:976— app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:976-984 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:1236-1244 — 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/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:515— app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:515-525 | app/src/main/java/com/webtoapp/ui/shell/ConsolePanel.kt:124-132 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt` and `app/src/main/java/com/webtoapp/ui/shell/ConsolePanel.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:515` it begins part-way through the construct above it, so those exact lines 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/webtoapp/core/notification/NotificationPollingService.kt:105— app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt:105-113 | app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:123-131 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot 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/webtoapp/core/agent/tool/builtin/GlobTool.kt:63— app/src/main/java/com/webtoapp/core/agent/tool/builtin/GlobTool.kt:63-69 | app/src/main/java/com/webtoapp/core/agent/tool/builtin/GrepTool.kt:126-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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/webtoapp/core/agent/tool/builtin/GlobTool.kt:63` 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/webtoapp/core/ai/AiApiClient.kt:2150— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2150-2156 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2167-2173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:2150` it does not close everything it opens, so those exact lines 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/webtoapp/core/apkbuilder/ApkBuilder.kt:190— app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:190-197 | app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:384-390 — 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/webtoapp/core/apkbuilder/ApkBuilder.kt:190` 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/webtoapp/core/extension/UserScriptParser.kt:74— app/src/main/java/com/webtoapp/core/extension/UserScriptParser.kt:74-80 | app/src/main/java/com/webtoapp/core/plugin/PluginImporter.kt:198-205 — 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/webtoapp/core/extension/UserScriptParser.kt:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) app/src/main/java/com/webtoapp/core/floatingwindow/FloatingWindowManager.kt:679— app/src/main/java/com/webtoapp/core/floatingwindow/FloatingWindowManager.kt:679-685 | app/src/main/java/com/webtoapp/core/floatingwindow/FloatingWindowManager.kt:1296-1302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/floatingwindow/FloatingWindowManager.kt:679` it does not close everything it opens, so those 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/webtoapp/core/floatingwindow/FloatingWindowManager.kt:686` calls `clampWindowParamsToScreen` and `app/src/main/java/com/webtoapp/core/floatingwindow/FloatingWindowManager.kt:1303` 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 lines × 2) app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:368— app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:368-374 | app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:289-295 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:368` it begins part-way through the construct above it, so those exact lines 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/webtoapp/core/shell/ShellModeManager.kt:989— app/src/main/java/com/webtoapp/core/shell/ShellModeManager.kt:989-995 | app/src/main/java/com/webtoapp/data/model/WebApp.kt:1137-1143 — 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/webtoapp/core/shell/ShellModeManager.kt:989` 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/webtoapp/core/webview/LocalHttpToSocksBridge.kt:179— app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:179-185 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:252-258 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt` and `app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:2212— app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:2212-2218 | app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:2243-2249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/webview/NativeBridge.kt:2212` it does not close everything it opens, so those 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/webtoapp/core/webview/WebViewManager.kt:1780— app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:1780-1786 | app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:5862-5868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/webview/WebViewManager.kt:1780` it does not close everything it opens, so those exact lines 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/webtoapp/ui/components/ActivationCodeCard.kt:1248— app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1248-1255 | app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1474-1480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/ActivationCodeCard.kt:1248` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/components/Shimmer.kt:96— app/src/main/java/com/webtoapp/ui/components/Shimmer.kt:96-102 | app/src/main/java/com/webtoapp/ui/screens/AboutScreen.kt:2131-2137 — 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/webtoapp/ui/components/Shimmer.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.
Duplicated block (7 lines × 2) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:434— app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:434-440 | app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:600-606 — both copies are in the same file, so extract the 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/webtoapp/ui/shell/ShellScreen.kt:85— app/src/main/java/com/webtoapp/ui/shell/ShellScreen.kt:85-91 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:1645-1651 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.kt:175— app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.kt:175-181 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3090-3096 — 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/webtoapp/ui/shell/ShellWebViewCallbacks.kt:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:543— app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:543-549 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:572-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/ZipUtils.kt:12— app/src/main/java/com/webtoapp/core/apkbuilder/ZipUtils.kt:12-18 | app/src/main/java/com/webtoapp/core/crypto/EncryptedApkBuilder.kt:172-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:347— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:347-353 | app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:1656-1662 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:946— app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:946-952 | app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:1032-1039 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:946` it begins part-way through the construct above it, so those 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/webtoapp/util/HtmlProjectHelper.kt:115— app/src/main/java/com/webtoapp/util/HtmlProjectHelper.kt:115-121 | app/src/main/java/com/webtoapp/util/HtmlProjectHelper.kt:128-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/util/HtmlProjectHelper.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 (7 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:950— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:950-956 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1587-1593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:950` it begins part-way through the construct above it, so those exact lines 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/webtoapp/core/ai/AiApiClient.kt:1033— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1033-1039 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2357-2363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:1033` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/webtoapp/core/webview/LocalHttpToSocksBridge.kt:57— app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:57-63 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:121-127 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt` and `app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) app/src/main/java/com/webtoapp/core/notification/NotificationFcmManager.kt:191— app/src/main/java/com/webtoapp/core/notification/NotificationFcmManager.kt:191-197 | app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:559-565 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:648— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:648-653 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2381-2386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:648` it does not close everything it opens, so those exact lines 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:337— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:337-342 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:855-861 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:337` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1945— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1945-1951 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:443-448 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:180— app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:180-192 | app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:159-164 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:180` it does not close everything it opens, so those 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/webtoapp/core/golang/GoRuntime.kt:194` calls `i` and `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:166` 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/webtoapp/core/notification/NotificationPollingService.kt:422— app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt:422-427 | app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:628-633 — 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/webtoapp/core/notification/NotificationPollingService.kt:422` it does not close everything it opens, so those 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/webtoapp/core/notification/NotificationWebSocketService.kt:635` calls `incrementAndGet` and `app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt:429` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:78— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:78-83 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:59-64 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/php/PhpAppRuntime.kt:78` it begins part-way through the construct above it, so those exact lines 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/webtoapp/core/python/ElfInterpPatcher.kt:88— app/src/main/java/com/webtoapp/core/python/ElfInterpPatcher.kt:88-93 | app/src/main/java/com/webtoapp/core/python/ElfInterpPatcher.kt:145-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:851— app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:851-856 | app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:882-887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:851` 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/webtoapp/core/webview/DownloadBridge.kt:725— app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:725-730 | app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:820-826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:725` it does not close everything it opens, so those exact lines 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/webtoapp/ui/components/ActivationCodeCard.kt:1268— app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1268-1274 | app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1487-1492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/ActivationCodeCard.kt:1268` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/components/NodeExtensionsCard.kt:55— app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt:55-60 | app/src/main/java/com/webtoapp/ui/components/PythonExtensionsCard.kt:55-60 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt` and `app/src/main/java/com/webtoapp/ui/components/PythonExtensionsCard.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/components/NodeExtensionsCard.kt:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:752— app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:752-757 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:817-826 — 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/webtoapp/ui/screens/CreatePhpAppScreen.kt:752` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt:347— app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt:347-352 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:472-477 — 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/webtoapp/ui/shell/ShellPermissionDelegate.kt:347` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1145— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1145-1150 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:435-440 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2050— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2050-2055 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:511-516 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/core/nodejs/NodeRuntime.kt:325— app/src/main/java/com/webtoapp/core/nodejs/NodeRuntime.kt:325-330 | app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:493-498 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1652— app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1652-1657 | app/src/main/java/com/webtoapp/ui/components/EnhancedActivationDialog.kt:580-585 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/util/HtmlProjectProcessor.kt:326— app/src/main/java/com/webtoapp/util/HtmlProjectProcessor.kt:326-331 | app/src/main/java/com/webtoapp/util/HtmlProjectProcessor.kt:399-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/webtoapp/util/HtmlProjectProcessor.kt:326` it does not close everything it opens, so those exact lines 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/webtoapp/ui/webview/WebViewActivity.kt:2716— app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:2716-2721 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:2858-2863 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/webview/WebViewActivity.kt:2716` it does not close everything it opens, so those exact lines 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/webtoapp/core/agent/llm/AnthropicProvider.kt:28— app/src/main/java/com/webtoapp/core/agent/llm/AnthropicProvider.kt:28-33 | app/src/main/java/com/webtoapp/core/agent/llm/OllamaProvider.kt:30-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/agent/llm/AnthropicProvider.kt:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) app/src/main/java/com/webtoapp/core/bgm/OnlineMusicApi.kt:183— app/src/main/java/com/webtoapp/core/bgm/OnlineMusicApi.kt:183-188 | app/src/main/java/com/webtoapp/core/bgm/OnlineMusicApi.kt:409-414 — both copies are in the same file, so extract the 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 (6 lines × 2) app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:2777— app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:2777-2782 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:2945-2950 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/webview/WebViewActivity.kt:2777` it does not close everything it opens, so those exact lines 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) .github/scripts/ci/generate_submissions.py:617— .github/scripts/ci/generate_submissions.py:617-622 | .github/scripts/ci/generate_submissions.py:641-647 — both copies are in the same file, so extract the 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) .github/scripts/ci/validate_modules.py:516— .github/scripts/ci/validate_modules.py:516-521 | .github/scripts/ci/validate_modules.py:525-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.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/core/agent/export/SaveSessionAsModuleUseCase.kt:97— app/src/main/java/com/webtoapp/core/agent/export/SaveSessionAsModuleUseCase.kt:97-101 | app/src/main/java/com/webtoapp/core/agent/export/SaveSessionAsModuleUseCase.kt:191-195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/agent/export/SaveSessionAsModuleUseCase.kt:97` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:205— app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:205-209 | app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:356-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/apkbuilder/ArscRebuilder.kt:205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2387— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2387-2392 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:681-685 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2387` it does not close everything it opens, so those 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/webtoapp/core/appmodifier/AppCloner.kt:653— app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:653-657 | app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:678-682 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:659` calls `RectF` and `app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:684` 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 (5 lines × 2) app/src/main/java/com/webtoapp/core/bgm/OnlineMusicApi.kt:131— app/src/main/java/com/webtoapp/core/bgm/OnlineMusicApi.kt:131-135 | app/src/main/java/com/webtoapp/core/bgm/OnlineMusicApi.kt:148-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/bgm/OnlineMusicApi.kt:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/core/crypto/IntegrityChecker.kt:171— app/src/main/java/com/webtoapp/core/crypto/IntegrityChecker.kt:171-175 | app/src/main/java/com/webtoapp/core/crypto/RuntimeProtection.kt:373-377 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1726— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1726-1730 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1768-1772 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/engine/GeckoViewEngine.kt:1726` 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/webtoapp/core/python/ElfInterpPatcher.kt:98— app/src/main/java/com/webtoapp/core/python/ElfInterpPatcher.kt:98-102 | app/src/main/java/com/webtoapp/core/python/ElfInterpPatcher.kt:155-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/python/ElfInterpPatcher.kt:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/core/stats/LivePreviewServerLauncher.kt:115— app/src/main/java/com/webtoapp/core/stats/LivePreviewServerLauncher.kt:115-119 | app/src/main/java/com/webtoapp/core/stats/LivePreviewServerLauncher.kt:163-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, 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/webtoapp/core/stats/LivePreviewServerLauncher.kt:168` calls `detectDocumentRoot` and `app/src/main/java/com/webtoapp/core/stats/LivePreviewServerLauncher.kt:120` 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 (5 lines × 2) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:2092— app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:2092-2096 | app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:2621-2625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/webview/WebViewManager.kt:2092` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:846— app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:846-852 | app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:852-856 — 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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:846` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/ui/screens/create/common/ProjectImportSupport.kt:43— app/src/main/java/com/webtoapp/ui/screens/create/common/ProjectImportSupport.kt:43-47 | app/src/main/java/com/webtoapp/ui/screens/create/runtime/PythonProjectImportAnalyzer.kt:225-229 — 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/webtoapp/ui/screens/create/common/ProjectImportSupport.kt:43` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/util/BoundedBitmaps.kt:59— app/src/main/java/com/webtoapp/util/BoundedBitmaps.kt:59-63 | app/src/main/java/com/webtoapp/util/BoundedBitmaps.kt:76-80 — both copies are in the same file, so extract the 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 (5 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:956— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:956-960 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:406-410 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:444— app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:444-448 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:1493-1497 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:304— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:304-308 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1850-1855 — both copies are in the same file, so extract the 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 (5 lines × 2) app/src/main/java/com/webtoapp/core/webview/CustomCaTrustStore.kt:135— app/src/main/java/com/webtoapp/core/webview/CustomCaTrustStore.kt:135-139 | app/src/main/java/com/webtoapp/core/webview/TlsUpstreamConnector.kt:120-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:904— app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:904-908 | app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:1445-1449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/viewmodel/MainViewModel.kt:904` it does not close everything it opens, so those exact lines 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/webtoapp/core/adblock/AdBlocker.kt:1535— app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:1535-1539 | app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:2424-2428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlEditor.kt:301— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlEditor.kt:301-305 | app/src/main/java/com/webtoapp/core/playstore/aab/axml/AxmlReader.kt:290-294 — 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/webtoapp/core/apkbuilder/AxmlEditor.kt:301` 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/webtoapp/core/appmodifier/CloneManifestRewriter.kt:66— app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:66-70 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:112-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) REDACTED:388— REDACTED:388-392 | app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:86-90 — 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 `REDACTED: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 (5 lines × 2) app/src/main/java/com/webtoapp/ui/screens/LinuxEnvironmentScreen.kt:1238— app/src/main/java/com/webtoapp/ui/screens/LinuxEnvironmentScreen.kt:1238-1242 | app/src/main/java/com/webtoapp/ui/screens/RuntimeDepsScreen.kt:1237-1241 — 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 (5 lines × 2) app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:1138— app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:1138-1142 | app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:1195-1199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
ClassTooLong: ApkBuilder app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:61— ClassTooLong — 2758 significant lines (blank, comment-only and punctuation-only lines excluded), 82 methods. The bar is 400 significant lines; this is 2358 over it, 6.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: AiApiClient app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:23— ClassTooLong — 1739 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 400 significant lines; this is 1339 over it, 4.35× 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: AdBlocker app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:22— ClassTooLong — 1688 significant lines (blank, comment-only and punctuation-only lines excluded), 93 methods. The bar is 400 significant lines; this is 1288 over it, 4.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: AxmlRebuilder app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:8— ClassTooLong — 1673 significant lines (blank, comment-only and punctuation-only lines excluded), 60 methods. The bar is 400 significant lines; this is 1273 over it, 4.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: NativeBridge app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:59— ClassTooLong — 1659 significant lines (blank, comment-only and punctuation-only lines excluded), 89 methods. The bar is 400 significant lines; this is 1259 over it, 4.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.
ClassTooLong: GeckoViewEngine app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:46— ClassTooLong — 1588 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 1188 over it, 3.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AgentViewModel app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt:57— ClassTooLong — 1527 significant lines (blank, comment-only and punctuation-only lines excluded), 99 methods. The bar is 400 significant lines; this is 1127 over it, 3.82× 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: MainViewModel app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:41— ClassTooLong — 1124 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 400 significant lines; this is 724 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: AppDatabase app/src/main/java/com/webtoapp/data/database/AppDatabase.kt:26— ClassTooLong — 1114 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 714 over it, 2.79× 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: FloatingWindowManager app/src/main/java/com/webtoapp/core/floatingwindow/FloatingWindowManager.kt:32— ClassTooLong — 958 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 558 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.
ClassTooLong: ShellActivity app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:37— ClassTooLong — 938 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 538 over it, 2.35× 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: JarSigner app/src/main/java/com/webtoapp/core/apkbuilder/JarSigner.kt:21— ClassTooLong — 925 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 400 significant lines; this is 525 over it, 2.31× 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: DownloadBridge app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:21— ClassTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 450 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DataBackupManager app/src/main/java/com/webtoapp/core/backup/DataBackupManager.kt:53— ClassTooLong — 790 significant lines (blank, comment-only and punctuation-only lines excluded), 29 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: PythonRuntime app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:23— ClassTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 287 over it, 1.72× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ShellPermissionDelegate app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt:32— ClassTooLong — 624 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 224 over it, 1.56× 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: CloneManifestRewriter app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:7— ClassTooLong — 566 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 166 over it, 1.42× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NotificationWebSocketService app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:41— ClassTooLong — 539 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 139 over it, 1.35× 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: MediaSessionBridge app/src/main/java/com/webtoapp/core/webview/MediaSessionBridge.kt:32— ClassTooLong — 504 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 104 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AppCloner app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:35— ClassTooLong — 498 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 98 over it, 1.25× 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: WebsiteScraper REDACTED:19— ClassTooLong — 463 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 63 over it, 1.16× 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: MediaSessionCore app/src/main/java/com/webtoapp/core/webview/MediaSessionCore.kt:40— ClassTooLong — 451 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 51 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ArscRebuilder app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:7— ClassTooLong — 437 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 37 over it, 1.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.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1089— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1089-1096 | app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:50-57 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt` as WHOLE FILES: this scan already matched 7 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/ai/AiApiClient.kt:1089` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:270— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:270-277 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:206-213 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscToProtoTable.kt:190— app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscToProtoTable.kt:190-197 | app/src/main/java/com/webtoapp/core/playstore/aab/axml/AxmlToProtoXml.kt:98-105 — 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/webtoapp/core/playstore/aab/arsc/ArscToProtoTable.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 (8 lines × 2) app/src/main/java/com/webtoapp/core/plugin/PluginMigrator.kt:307— app/src/main/java/com/webtoapp/core/plugin/PluginMigrator.kt:307-314 | app/src/main/java/com/webtoapp/core/plugin/PluginStore.kt:163-170 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/core/webview/PrintBridge.kt:174— app/src/main/java/com/webtoapp/core/webview/PrintBridge.kt:174-181 | app/src/main/java/com/webtoapp/core/webview/PrintBridge.kt:300-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/ui/agent/components/MarkdownText.kt:351— app/src/main/java/com/webtoapp/ui/agent/components/MarkdownText.kt:351-358 | app/src/main/java/com/webtoapp/ui/agent/components/MarkdownText.kt:374-382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/agent/components/MarkdownText.kt:351` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/ui/agent/components/ModelPickerDialog.kt:232— app/src/main/java/com/webtoapp/ui/agent/components/ModelPickerDialog.kt:232-239 | app/src/main/java/com/webtoapp/ui/agent/components/ModelPickerDialog.kt:283-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/agent/components/ModelPickerDialog.kt:232` 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/webtoapp/ui/components/BgmSelector.kt:762— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:762-769 | app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:847-854 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/BgmSelector.kt:762` it does not close everything it opens, so those exact lines 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/webtoapp/ui/components/RuntimeScreenComponents.kt:246— app/src/main/java/com/webtoapp/ui/components/RuntimeScreenComponents.kt:246-253 | app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:369-376 — 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/webtoapp/ui/components/RuntimeScreenComponents.kt:246` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/ui/components/announcement/AnnouncementTemplates.kt:369— app/src/main/java/com/webtoapp/ui/components/announcement/AnnouncementTemplates.kt:369-376 | app/src/main/java/com/webtoapp/ui/components/announcement/AnnouncementTemplates.kt:419-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/announcement/AnnouncementTemplates.kt:369` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:852— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:852-859 | app/src/main/java/com/webtoapp/ui/shell/ShellUtils.kt:16-23 — 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:852` 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 (8 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2514— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2514-2521 | app/src/main/java/com/webtoapp/util/ZipProjectImporter.kt:248-255 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:293— app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:293-300 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:298-305 — 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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:293` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:658— app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:658-665 | app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:699-706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:658` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/shell/MultiWebShellMode.kt:813— app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt:813-820 | app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt:1118-1125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/shell/MultiWebShellMode.kt:813` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt:654— app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt:654-661 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:736-743 — 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/webtoapp/ui/shell/ShellPermissionDelegate.kt:654` it begins part-way through the construct above it, so those exact lines 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/webtoapp/core/frontend/FrontendProjectBuilder.kt:91— app/src/main/java/com/webtoapp/core/frontend/FrontendProjectBuilder.kt:91-98 | app/src/main/java/com/webtoapp/core/linux/NodeProjectBuilder.kt:121-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/core/i18n/PreviewHtmlSupport.kt:5— app/src/main/java/com/webtoapp/core/i18n/PreviewHtmlSupport.kt:5-12 | app/src/main/java/com/webtoapp/ui/screens/AppPreviewResolver.kt:498-505 — 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 (8 lines × 2) app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:505— app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:505-512 | app/src/main/java/com/webtoapp/core/wordpress/WordPressDependencyManager.kt:503-510 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2445— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2445-2452 | app/src/main/java/com/webtoapp/util/ZipProjectImporter.kt:196-203 — 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 (8 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellScreen.kt:496— app/src/main/java/com/webtoapp/ui/shell/ShellScreen.kt:496-503 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3403-3410 — 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 (8 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3318— app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3318-3325 | app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3331-3338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/apkbuilder/ApkBuilder.kt:3318` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:194— app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:194-201 | app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:237-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.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 (10 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:727— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:727-736 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2454-2463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:727` 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/webtoapp/core/ai/AiApiClient.kt:2453` calls `getAsJsonObject` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:726` 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/webtoapp/core/ai/provider/AiImageSupport.kt:36— app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:36-45 | app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:99-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/provider/AiImageSupport.kt:36` 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/webtoapp/core/ai/provider/AiImageSupport.kt:98` calls `getAsJsonObject` and `app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:35` 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:310— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:310-319 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:538-547 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:310` it does not close everything it opens, so those 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/webtoapp/core/autostart/AutoStartLauncher.kt:47— app/src/main/java/com/webtoapp/core/autostart/AutoStartLauncher.kt:47-56 | shell/src/main/java-overrides/com/webtoapp/core/autostart/AutoStartLauncher.kt:22-31 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/autostart/AutoStartLauncher.kt` and `shell/src/main/java-overrides/com/webtoapp/core/autostart/AutoStartLauncher.kt` as WHOLE FILES: 100% 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (10 lines × 2) app/src/main/java/com/webtoapp/core/engine/EngineViewFactory.kt:120— app/src/main/java/com/webtoapp/core/engine/EngineViewFactory.kt:120-129 | app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:1580-1589 — 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/webtoapp/core/engine/EngineViewFactory.kt:120` it begins part-way through the construct above it, so those exact lines 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/webtoapp/core/extension/DeclarativeNetRequestEngine.kt:290— app/src/main/java/com/webtoapp/core/extension/DeclarativeNetRequestEngine.kt:290-299 | app/src/main/java/com/webtoapp/core/extension/DeclarativeNetRequestEngine.kt:318-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/extension/DeclarativeNetRequestEngine.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.
Duplicated block (10 lines × 2) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:215— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:215-224 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:190-199 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:215` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:515— app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:515-524 | app/src/main/java/com/webtoapp/core/wordpress/WordPressDependencyManager.kt:579-588 — 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 (10 lines × 2) app/src/main/java/com/webtoapp/ui/agent/components/Composer.kt:350— app/src/main/java/com/webtoapp/ui/agent/components/Composer.kt:350-359 | app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:1435-1444 — 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/webtoapp/ui/agent/components/Composer.kt:350` 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/webtoapp/ui/agent/components/ModelPickerDialog.kt:276— app/src/main/java/com/webtoapp/ui/agent/components/ModelPickerDialog.kt:276-285 | app/src/main/java/com/webtoapp/ui/agent/components/SaveAsAppDialog.kt:204-213 — 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/webtoapp/ui/agent/components/ModelPickerDialog.kt:276` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/components/BgmCard.kt:52— app/src/main/java/com/webtoapp/ui/components/BgmCard.kt:52-61 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:460-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/BgmCard.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:364— app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:364-373 | app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:477-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/NotificationConfigCard.kt:364` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/src/main/java/com/webtoapp/ui/components/WtaCodeEditorDialog.kt:328— app/src/main/java/com/webtoapp/ui/components/WtaCodeEditorDialog.kt:328-337 | app/src/main/java/com/webtoapp/ui/components/WtaCodeEditorDialog.kt:431-440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/WtaCodeEditorDialog.kt:328` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:522— app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:522-531 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:585-594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateAppWebViewCards.kt:522` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/screens/CreateAppWebViewCards.kt:2098— app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:2098-2107 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:2128-2137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateAppWebViewCards.kt:2098` 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/webtoapp/ui/screens/CreateFrontendAppScreen.kt:988— app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:988-997 | app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:1335-1344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:988` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:931— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:931-940 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1159-1168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:931` it does not close everything it opens, so those 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1157` calls `Spacer`, `height` and `app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:929` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellBrowserView.kt:39— app/src/main/java/com/webtoapp/ui/shell/ShellBrowserView.kt:39-48 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:4029-4038 — 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/webtoapp/ui/shell/ShellBrowserView.kt:39` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/src/main/java/com/webtoapp/util/DownloadNotificationManager.kt:277— app/src/main/java/com/webtoapp/util/DownloadNotificationManager.kt:277-286 | app/src/main/java/com/webtoapp/util/DownloadNotificationManager.kt:444-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/util/DownloadNotificationManager.kt:277` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) clone-host/src/main/java/com/webtoapp/clone/CloneLauncherActivity.kt:219— clone-host/src/main/java/com/webtoapp/clone/CloneLauncherActivity.kt:219-228 | clone-host/src/main/java/com/webtoapp/clone/CloneLauncherActivity.kt:240-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clone-host/src/main/java/com/webtoapp/clone/CloneLauncherActivity.kt:219` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `clone-host/src/main/java/com/webtoapp/clone/CloneLauncherActivity.kt:237` calls `put` and `clone-host/src/main/java/com/webtoapp/clone/CloneLauncherActivity.kt:216` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) app/src/main/java/com/webtoapp/core/nodejs/NodeRuntime.kt:264— app/src/main/java/com/webtoapp/core/nodejs/NodeRuntime.kt:264-273 | app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:290-299 — 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/webtoapp/core/nodejs/NodeRuntime.kt:264` it begins part-way through the construct above it, so those 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 `sourceDir` to `File` in one and `File ): File = withContext(Dispatchers.IO` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) .github/scripts/ci/generate_submissions.py:385— .github/scripts/ci/generate_submissions.py:385-394 | .github/scripts/ci/generate_submissions.py:448-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `.github/scripts/ci/generate_submissions.py:459` calls `get` and `.github/scripts/ci/generate_submissions.py:395` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1130— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1130-1143 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1861-1874 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:1130` it does not close everything it opens, so those exact lines 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/webtoapp/core/ai/AiApiClient.kt:1570— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1570-1583 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2223-2236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:1570` it begins part-way through the construct above it, so those exact lines 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1958— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1958-1971 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:452-465 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1958` it does not close everything it opens, so those 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/webtoapp/core/extension/ChromeExtensionRuntime.kt:74— app/src/main/java/com/webtoapp/core/extension/ChromeExtensionRuntime.kt:74-87 | app/src/main/java/com/webtoapp/core/extension/ExtensionPopupManager.kt:44-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/webtoapp/core/extension/ChromeExtensionRuntime.kt:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) app/src/main/java/com/webtoapp/core/linux/HtmlProjectOptimizer.kt:226— app/src/main/java/com/webtoapp/core/linux/HtmlProjectOptimizer.kt:226-241 | app/src/main/java/com/webtoapp/core/linux/PerformanceOptimizerApk.kt:114-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/webtoapp/core/linux/HtmlProjectOptimizer.kt:226` it does not close everything it opens, so those exact lines 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:460— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:460-473 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:415-428 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:460` 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/webtoapp/core/logging/AppLogger.kt:300— app/src/main/java/com/webtoapp/core/logging/AppLogger.kt:300-313 | app/src/main/java/com/webtoapp/core/shell/ShellLogger.kt:135-148 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/logging/AppLogger.kt:300` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/webtoapp/core/logging/AppLogger.kt:299` calls `flushBuffer` and `app/src/main/java/com/webtoapp/core/shell/ShellLogger.kt:134` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:333— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:333-346 | app/src/main/java/com/webtoapp/ui/screens/create/runtime/PhpProjectImportAnalyzer.kt:120-133 — 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 (14 lines × 2) app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:453— app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:453-466 | app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:475-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:762— app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:762-775 | app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:924-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/webtoapp/ui/components/ActivationCodeCard.kt:762` it does not close everything it opens, so those 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/webtoapp/ui/components/ActivationCodeCard.kt:922` calls `getCodeTypeTheme` and `app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:761` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:49— app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:49-62 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:420-433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/LongPressMenu.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 (14 lines × 2) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:925— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:925-938 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:1031-1044 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:925` it does not close everything it opens, so those exact lines 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/webtoapp/ui/screens/CreateAppSplashCard.kt:162— app/src/main/java/com/webtoapp/ui/screens/CreateAppSplashCard.kt:162-175 | app/src/main/java/com/webtoapp/ui/screens/CreateAppSplashCard.kt:202-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/CreateAppSplashCard.kt:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellBgmPlayer.kt:85— app/src/main/java/com/webtoapp/ui/shell/ShellBgmPlayer.kt:85-98 | app/src/main/java/com/webtoapp/util/BgmStorage.kt:479-492 — 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/webtoapp/ui/shell/ShellBgmPlayer.kt:85` 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/webtoapp/ui/shell/ShellScaffoldLayout.kt:536— app/src/main/java/com/webtoapp/ui/shell/ShellScaffoldLayout.kt:536-549 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3834-3847 — 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/webtoapp/ui/shell/ShellScaffoldLayout.kt:536` it does not close everything it opens, so those exact lines 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/webtoapp/ui/shell/ShellWebViewCallbacks.kt:264— app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.kt:264-277 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3273-3286 — 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/webtoapp/ui/shell/ShellWebViewCallbacks.kt:264` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/webview/WebViewActivity.kt:3956— app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3956-3969 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:4238-4251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/webview/WebViewActivity.kt:3956` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/shell/ShellActivity.kt:268— app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:268-281 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:1246-1259 — 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/webtoapp/ui/webview/ServerPreviewOverlays.kt:43— app/src/main/java/com/webtoapp/ui/webview/ServerPreviewOverlays.kt:43-56 | app/src/main/java/com/webtoapp/ui/webview/ServerPreviewOverlays.kt:112-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/webtoapp/ui/webview/ServerPreviewOverlays.kt:43` 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 · ×19
Suspend function with a blocking request: downloadFilterText app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:1519— `downloadFilterText` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: importHostsFromUrl app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:2318— `importHostsFromUrl` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: generate app/src/main/java/com/webtoapp/core/agent/imagery/OpenAiImageGenerator.kt:39— `generate` 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: generate app/src/main/java/com/webtoapp/core/agent/imagery/GeminiImageGenerator.kt:35— `generate` 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: testConnection app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:49— `testConnection` 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: fetchModels app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:151— `fetchModels` 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: downloadFileEx app/src/main/java/com/webtoapp/core/download/DependencyDownloadEngine.kt:201— `downloadFileEx` suspends, but makes its request with `call.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: preloadRequires app/src/main/java/com/webtoapp/core/extension/ExtensionFileManager.kt:376— `preloadRequires` 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: preloadResources app/src/main/java/com/webtoapp/core/extension/ExtensionFileManager.kt:410— `preloadResources` 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: downloadFile app/src/main/java/com/webtoapp/core/linux/NativeNodeEngine.kt:223— `downloadFile` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: fetchScripts app/src/main/java/com/webtoapp/core/market/GreasyForkSearch.kt:126— `fetchScripts` 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: fetchScriptCode app/src/main/java/com/webtoapp/core/market/GreasyForkSearch.kt:165— `fetchScriptCode` 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: search app/src/main/java/com/webtoapp/core/market/ChromeWebStoreSearch.kt:71— `search` 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: fetchDetails app/src/main/java/com/webtoapp/core/market/ChromeWebStoreSearch.kt:157— `fetchDetails` 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: checkUrl app/src/main/java/com/webtoapp/core/stats/AppHealthMonitor.kt:46— `checkUrl` 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: downloadPacScript app/src/main/java/com/webtoapp/core/webview/PacProxyManager.kt:373— `downloadPacScript` 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: fetch app/src/main/java/com/webtoapp/util/UrlMetadataFetcher.kt:62— `fetch` 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: saveFromUrl app/src/main/java/com/webtoapp/util/MediaSaver.kt:76— `saveFromUrl` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: saveFromUrlWithHeaders app/src/main/java/com/webtoapp/util/MediaSaver.kt:122— `saveFromUrlWithHeaders` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Repeated repair: app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt:47— app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt changed 9 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 8 (its worst body is ApkTemplate.deriveLauncherBackgroundColor at line 47), 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: shrink the host launcher glyph and keep a transparent plate (#1281)”; “fix: stop painting transparent launcher icons on black (#1273)”; “fix: repo audit batch 2 — zip-slip & zip-bomb hardening, bridge redirect gates, 16KB alignment, cache fingerprints, agent & shell parity (issue #826) (#827)”; “fix(bitmap): bound all untrusted decodes, fixes oversized-bitmap crash (#788)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.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/webtoapp/core/golang/GoToolchainManager.kt app/src/main/java/com/webtoapp/core/golang/GoToolchainManager.kt:415— app/src/main/java/com/webtoapp/core/golang/GoToolchainManager.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 GoToolchainManager.extractGoArchiveToRoot at line 415), 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: pin the on-device Go toolchain to 1.26.10 (#1354) (#1355)”; “fix(security): pin runtime download digests, fail loud on identity rewrites, fail closed on key encryption (#958)”; “fix(i18n): complete translation leak audit + runtime language propagation (#946)”; “fix(download): surface runtime-download progress during ensure and harden the stall watchdog (#855)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/golang/GoToolchainManager.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/webtoapp/core/wordpress/WordPressDependencyManager.kt app/src/main/java/com/webtoapp/core/wordpress/WordPressDependencyManager.kt:271— app/src/main/java/com/webtoapp/core/wordpress/WordPressDependencyManager.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 9 (its worst body is WordPressDependencyManager.resolvePhpExecutable at line 271), 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 dynamic-row text squeeze and add cancel to runtime download dialogs (#1087)”; “fix(security): pin runtime download digests, fail loud on identity rewrites, fail closed on key encryption (#958)”; “fix(i18n): complete translation leak audit + runtime language propagation (#946)”; “fix(download): surface runtime-download progress during ensure and harden the stall watchdog (#855)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/wordpress/WordPressDependencyManager.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/webtoapp/ui/shell/ShellActivityInit.kt app/src/main/java/com/webtoapp/ui/shell/ShellActivityInit.kt:117— app/src/main/java/com/webtoapp/ui/shell/ShellActivityInit.kt changed 9 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 9 (its worst body is ShellActivityInit.initNotificationService at line 117), 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: let the floating window outrank fullscreen mode (#1387)”; “fix: exit on one back press once page history is empty (#1380)”; “Simplify Build APK page UX and fix dead/misleading build options (#1093)”; “fix(engine): GeckoView parity — revive CORS bridge, navigation, prompts, errors, find-in-page (#825)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/shell/ShellActivityInit.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/webtoapp/core/webview/MediaSessionBridge.kt app/src/main/java/com/webtoapp/core/webview/MediaSessionBridge.kt:138— app/src/main/java/com/webtoapp/core/webview/MediaSessionBridge.kt changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is MediaSessionBridge.updatePlaybackState at line 138), 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(media): re-inject media session polyfill per navigation without document-start (#977)”; “fix(webview): stop per-page instrumentations from taxing the JS thread (#956)”; “fix(media): interpolate lock-screen progress and add GeckoView media session (#596)”; “fix(media): arbitrate frames, polyfill navigator.mediaSession, stop none/zero clobbering (#576)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/webview/MediaSessionBridge.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/webtoapp/core/engine/EngineViewFactory.kt app/src/main/java/com/webtoapp/core/engine/EngineViewFactory.kt:116— app/src/main/java/com/webtoapp/core/engine/EngineViewFactory.kt changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is EngineViewFactory.prepareGeckoNetwork at line 116), 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(webview): keep hardware-keyboard modifiers on Enter for generated apps (#1032) (#1042)”; “fix(engine): GeckoView parity — revive CORS bridge, navigation, prompts, errors, find-in-page (#825)”; “fix(engine): propagate onNewWindow Boolean through the engine callback chain”; “fix(engine): actually request Android permissions for GeckoView (geolocation/camera/mic) (#353)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/engine/EngineViewFactory.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/webtoapp/core/webview/WebMediaPlaybackService.kt app/src/main/java/com/webtoapp/core/webview/WebMediaPlaybackService.kt:37— app/src/main/java/com/webtoapp/core/webview/WebMediaPlaybackService.kt changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is WebMediaPlaybackService.onStartCommand at line 37), 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: renew media wake-lock timeout on every PLAYING report (#1051) (#1052)”; “Fix generated APK crash on missing WAKE_LOCK during media playback (#1044)”; “fix(security): harden TLS MITM trust chain, JS bridges, export pipeline and runtimes (#815)”; “fix(media): interpolate lock-screen progress and add GeckoView media session (#596)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/webview/WebMediaPlaybackService.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/webtoapp/core/webview/WebViewCallbacks.kt app/src/main/java/com/webtoapp/core/webview/WebViewCallbacks.kt:9— app/src/main/java/com/webtoapp/core/webview/WebViewCallbacks.kt changed 5 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 1 (its worst body is WebViewCallbacks.onPageCommitVisible at line 9), 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(webview): recover generated apps from background renderer/process kills (#1030) (#1040)”; “fix(engine): GeckoView parity — revive CORS bridge, navigation, prompts, errors, find-in-page (#825)”; “fix(webview): keep OAuth sign-in inside the app WebView and let it complete”; “fix(webview): replace geolocation backend with native LocationManager bridge (#583)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/webview/WebViewCallbacks.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/webtoapp/core/activation/ActivationManager.kt app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt:217— app/src/main/java/com/webtoapp/core/activation/ActivationManager.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 14 (its worst body is ActivationManager.validateActivationCode at line 217), 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(activation): reuse the remembered card at launch instead of demanding it every time (#843)”; “fix: bump version on rebuild and honour an absolute activation expiry (#686)”; “fix(activation): drop the dead device-binding option from local codes (#570)”; “fix(activation): enforce device-bound codes via remote verifier + honest local labeling (#448) (#489)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/activation/ActivationManager.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/webtoapp/core/engine/BrowserEngineCallback.kt app/src/main/java/com/webtoapp/core/engine/BrowserEngineCallback.kt:42— app/src/main/java/com/webtoapp/core/engine/BrowserEngineCallback.kt changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is BrowserEngineCallback.onShowFileChooser at line 42), 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(engine): GeckoView parity — revive CORS bridge, navigation, prompts, errors, find-in-page (#825)”; “fix(engine): propagate onNewWindow Boolean through the engine callback chain”; “fix(engine): actually request Android permissions for GeckoView (geolocation/camera/mic) (#353)”; “fix(engine): support file upload (<input type=file>) in the GeckoView engine (#321)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/engine/BrowserEngineCallback.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: REDACTED REDACTED:21— REDACTED 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 5 (its worst body is AdBlockFilterCache.getCachedUrlContent at line 21), 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 custom filter lists not refreshing past the 24h URL cache (#1076) (#1099)”; “fix(adblock): uBO :style() cosmetic support, poison-proof hide batches, list title metadata (#833)”; “fix(adblock): stop the OutOfMemoryError crash loop on startup and the App Creation screen (#359)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: app/src/main/java/com/webtoapp/core/activation/RemoteActivationVerifier.kt app/src/main/java/com/webtoapp/core/activation/RemoteActivationVerifier.kt:68— app/src/main/java/com/webtoapp/core/activation/RemoteActivationVerifier.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 14 (its worst body is RemoteActivationVerifier.verify at line 68), 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(activation): reuse the remembered card at launch instead of demanding it every time (#843)”; “fix(activation): remote startup cache was invalidated by the empty-code probe (#565)”; “fix(activation): enforce device-bound codes via remote verifier + honest local labeling (#448) (#489)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/activation/RemoteActivationVerifier.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/webtoapp/ui/components/EncryptionConfigCard.kt app/src/main/java/com/webtoapp/ui/components/EncryptionConfigCard.kt:26— app/src/main/java/com/webtoapp/ui/components/EncryptionConfigCard.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 6 (its worst body is EncryptionConfigCardKt.EncryptionConfigCard at line 26), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ui): drop redundant "Not enabled" subtitles on config cards (#1147)”; “Simplify Build APK page UX and fix dead/misleading build options (#1093)”; “Fix dynamic-row text squeeze and add cancel to runtime download dialogs (#1087)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/components/EncryptionConfigCard.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/webtoapp/core/agent/permission/PermissionChecker.kt app/src/main/java/com/webtoapp/core/agent/permission/PermissionChecker.kt:87— app/src/main/java/com/webtoapp/core/agent/permission/PermissionChecker.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 6 (its worst body is PermissionChecker.checkDefault at line 87), 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: repo audit batch 2 — zip-slip & zip-bomb hardening, bridge redirect gates, 16KB alignment, cache fingerprints, agent & shell parity (issue #826) (#827)”; “fix(agent): allow plan-file writes when plan mode is entered mid-turn (#744)”; “fix(agent): stop plan-mode permission leak and truncated-arg silent execution (#587)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/agent/permission/PermissionChecker.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/webtoapp/core/webview/TranslateBridge.kt app/src/main/java/com/webtoapp/core/webview/TranslateBridge.kt:191— app/src/main/java/com/webtoapp/core/webview/TranslateBridge.kt changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is TranslateBridge.translatePayload at line 191), 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: translate long pages in sized chunks instead of one GET (#1331)”; “fix: repo audit batch 2 — zip-slip & zip-bomb hardening, bridge redirect gates, 16KB alignment, cache fingerprints, agent & shell parity (issue #826) (#827)”; “fix(security): harden TLS MITM trust chain, JS bridges, export pipeline and runtimes (#815)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/webview/TranslateBridge.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/webtoapp/ui/design/WtaDisplay.kt app/src/main/java/com/webtoapp/ui/design/WtaDisplay.kt:104— app/src/main/java/com/webtoapp/ui/design/WtaDisplay.kt changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is WtaDisplayKt.WtaIconTitle at line 104), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ui): make feature-card header subtitles expandable (#1135) (#1136)”; “Fix dynamic-row text squeeze and add cancel to runtime download dialogs (#1087)”; “fix(ui): unify card title font sizes in FloatingWindow/DNS/AutoStart (#391)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/design/WtaDisplay.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/webtoapp/core/notification/NotificationWebSocketService.kt app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:317— app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is NotificationWebSocketService.onStartCommand at line 317), 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 generated APK crash on missing WAKE_LOCK during media playback (#1044)”; “fix(security): harden TLS MITM trust chain, JS bridges, export pipeline and runtimes (#815)”; “fix(push): restart the WebSocket service via a foreground-service alarm PendingIntent (#753)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.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/webtoapp/ui/components/StatusBarBackground.kt app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:125— app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is StatusBarBackgroundKt.StatusBarOverlay at line 125), 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(bitmap): bound all untrusted decodes, fixes oversized-bitmap crash (#788)”; “fix(statusbar): repair show-status-bar chain and refresh content-padding UI (#763)”; “fix(shell): stop fabricating a 24dp status-bar band when insets report 0 (#683)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 01:27:06 +08:00' --until='2026-10-25 01:27:06 +08:00' --full-history --no-merges -- app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.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 (17 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:820— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:820-836 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1684-1700 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:820` 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/webtoapp/core/ai/AiApiClient.kt:2466— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2466-2482 | app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:111-127 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (17 lines × 2) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:145— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:145-161 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:129-145 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:283— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:283-299 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:220-236 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:283` 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:312— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:312-328 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:249-265 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (17 lines × 2) app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:960— app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:960-976 | app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:987-1003 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/webview/DownloadBridge.kt:960` it does not close everything it opens, so those exact lines 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/webtoapp/core/webview/WebViewManager.kt:3722— app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3722-3738 | app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3794-3810 — both copies are in the same file, so extract the 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/webtoapp/ui/components/BackgroundRunConfigCard.kt:95— app/src/main/java/com/webtoapp/ui/components/BackgroundRunConfigCard.kt:95-112 | app/src/main/java/com/webtoapp/ui/components/BgmCard.kt:103-119 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/BackgroundRunConfigCard.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 (17 lines × 2) app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1514— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1514-1530 | app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:369-385 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1514` it does not close everything it opens, so those exact lines 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/webtoapp/ui/components/LongPressMenu.kt:694— app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:694-710 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:1298-1314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/LongPressMenu.kt:694` 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/webtoapp/ui/components/NotificationConfigCard.kt:380— app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:380-396 | app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:493-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/NotificationConfigCard.kt:380` 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/webtoapp/ui/design/WtaFeatureCard.kt:48— app/src/main/java/com/webtoapp/ui/design/WtaFeatureCard.kt:48-64 | app/src/main/java/com/webtoapp/ui/design/WtaFeatureCard.kt:86-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/design/WtaFeatureCard.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 (17 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:253— app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:253-269 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:405-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateAppWebViewCards.kt:253` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1740— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1740-1756 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2183-2199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1740` 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/webtoapp/ui/screens/HostsAdBlockScreen.kt:341— app/src/main/java/com/webtoapp/ui/screens/HostsAdBlockScreen.kt:341-357 | app/src/main/java/com/webtoapp/ui/screens/HostsAdBlockScreen.kt:378-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/HostsAdBlockScreen.kt:341` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/ApkArtifactVerifier.kt:409— app/src/main/java/com/webtoapp/core/apkbuilder/ApkArtifactVerifier.kt:409-425 | app/src/main/java/com/webtoapp/core/apkbuilder/ApkArtifactVerifier.kt:440-456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/apkbuilder/ApkArtifactVerifier.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 (16 lines × 2) app/src/main/java/com/webtoapp/WebToAppApplication.kt:210— app/src/main/java/com/webtoapp/WebToAppApplication.kt:210-225 | shell/src/main/java-overrides/com/webtoapp/WebToAppApplication.kt:62-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (16 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:4903— app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:4903-4918 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3885-3900 — 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/webtoapp/core/apkbuilder/ApkBuilder.kt:4903` it does not close everything it opens, so those exact lines 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/webtoapp/core/crypto/KeyManager.kt:108— app/src/main/java/com/webtoapp/core/crypto/KeyManager.kt:108-123 | app/src/main/java/com/webtoapp/core/crypto/RuntimeProtection.kt:386-401 — 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/webtoapp/core/crypto/KeyManager.kt:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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/webtoapp/core/crypto/KeyManager.kt:124` calls `Suppress` and `app/src/main/java/com/webtoapp/core/crypto/RuntimeProtection.kt:402` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) app/src/main/java/com/webtoapp/core/nodejs/NodeRuntime.kt:303— app/src/main/java/com/webtoapp/core/nodejs/NodeRuntime.kt:303-318 | app/src/main/java/com/webtoapp/ui/screens/create/runtime/GoProjectSourceLoader.kt:34-49 — 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/webtoapp/core/nodejs/NodeRuntime.kt:303` 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/webtoapp/core/php/PhpAppRuntime.kt:362— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:362-377 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:229-244 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (16 lines × 2) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3695— app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3695-3710 | app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3777-3792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/webview/WebViewManager.kt:3695` it does not close everything it opens, so those exact lines 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/webtoapp/ui/agent/components/AppChangesReviewCard.kt:112— app/src/main/java/com/webtoapp/ui/agent/components/AppChangesReviewCard.kt:112-127 | app/src/main/java/com/webtoapp/ui/agent/components/ChangesReviewCard.kt:119-134 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/agent/components/AppChangesReviewCard.kt` and `app/src/main/java/com/webtoapp/ui/agent/components/ChangesReviewCard.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/agent/components/AppChangesReviewCard.kt:112` it does not close everything it opens, so those exact lines 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/webtoapp/ui/design/WtaDisplay.kt:114— app/src/main/java/com/webtoapp/ui/design/WtaDisplay.kt:114-129 | app/src/main/java/com/webtoapp/ui/design/WtaDisplay.kt:168-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/design/WtaDisplay.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.
Duplicated block (16 lines × 2) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:874— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:874-889 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:977-992 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:874` it does not close everything it opens, so those exact lines 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/webtoapp/ui/screens/AiSettingsScreen.kt:490— app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:490-505 | app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:683-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/webtoapp/ui/screens/AiSettingsScreen.kt:490` 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/webtoapp/ui/shell/ShellBrowserView.kt:223— app/src/main/java/com/webtoapp/ui/shell/ShellBrowserView.kt:223-238 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:4300-4315 — 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/webtoapp/ui/shell/ShellBrowserView.kt:223` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/shell/ShellMediaContent.kt:371— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:371-386 | app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:402-417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:371` 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/webtoapp/ui/shell/ShellServerModes.kt:351— app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:351-366 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:511-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:351` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) app/src/main/java/com/webtoapp/util/FaviconFetcher.kt:197— app/src/main/java/com/webtoapp/util/FaviconFetcher.kt:197-212 | app/src/main/java/com/webtoapp/util/UrlMetadataFetcher.kt:201-216 — 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 (16 lines × 2) app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt:18— app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt:18-33 | shell/src/main/java-overrides/com/webtoapp/core/autostart/BootReceiver.kt:18-33 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt` and `shell/src/main/java-overrides/com/webtoapp/core/autostart/BootReceiver.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) scripts/generate_shell_strings.py:98— scripts/generate_shell_strings.py:98-113 | scripts/generate_shell_strings.py:118-133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×13
Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:127— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:127-149 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:763-784 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1535-1554 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2312-2335 — 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/webtoapp/core/ai/AiApiClient.kt:717— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:717-736 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2443-2463 | app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:26-45 | app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:88-108 — 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/webtoapp/core/ai/AiApiClient.kt:933— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:933-962 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1015-1044 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1564-1599 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2344-2369 — 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:168— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:168-224 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:152-199 | app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:129-172 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:202-245 — 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:440— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:440-455 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:395-410 | app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:265-276 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:721-732 — 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/webtoapp/core/webview/DownloadBridge.kt:958— app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:958-983 | app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:985-1010 | app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:1046-1073 | app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:1075-1103 — 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/webtoapp/ui/components/BgmSelector.kt:57— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:57-615 | app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1318-1552 | app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:44-408 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:50-467 — 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/webtoapp/ui/components/IconGeneratorDialog.kt:45— app/src/main/java/com/webtoapp/ui/components/IconGeneratorDialog.kt:45-346 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1400-1451 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1912-1986 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1992-2070 — 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/webtoapp/ui/components/LongPressMenu.kt:117— app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:117-175 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:326-410 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:488-536 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:609-684 — 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/webtoapp/ui/components/LongPressMenu.kt:183— app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:183-243 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:252-315 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:545-599 | app/src/main/java/com/webtoapp/ui/screens/HostsAdBlockScreen.kt:577-630 — 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/webtoapp/ui/components/NodeExtensionsCard.kt:40— app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt:40-132 | app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt:46-174 | app/src/main/java/com/webtoapp/ui/components/PythonExtensionsCard.kt:40-132 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:887-1019 — 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:331— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:331-381 | app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:873-916 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:54-394 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:976-1022 — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:57— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:57-531 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:63-1018 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:71-690 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:59-699 — 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 (18 lines × 2) app/src/main/java/com/webtoapp/core/background/BackgroundRunService.kt:198— app/src/main/java/com/webtoapp/core/background/BackgroundRunService.kt:198-215 | app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt:185-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/webtoapp/core/background/BackgroundRunService.kt:198` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, 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/webtoapp/core/background/BackgroundRunService.kt:216` calls `elapsedRealtime` and `app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt:203` 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 (18 lines × 2) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:474— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:474-491 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:324-341 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/php/PhpAppRuntime.kt:474` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:1049— app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:1049-1066 | app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:1079-1096 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/webview/DownloadBridge.kt:1049` it does not close everything it opens, so those exact lines 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/webtoapp/ui/agent/components/AgentDrawer.kt:412— app/src/main/java/com/webtoapp/ui/agent/components/AgentDrawer.kt:412-429 | app/src/main/java/com/webtoapp/ui/agent/components/AgentDrawer.kt:570-587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/agent/components/AgentDrawer.kt:412` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:287— app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:287-304 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:580-597 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:287` 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/webtoapp/ui/components/LrcEditorDialog.kt:100— app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:100-117 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:145-162 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt` and `app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/components/LrcEditorDialog.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. 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 (18 lines × 2) app/src/main/java/com/webtoapp/ui/components/WtaErrorView.kt:111— app/src/main/java/com/webtoapp/ui/components/WtaErrorView.kt:111-128 | app/src/main/java/com/webtoapp/ui/shell/ShellErrorScreen.kt:152-169 — 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/webtoapp/ui/components/WtaErrorView.kt:111` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:411— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:411-428 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:878-895 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:411` 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/webtoapp/ui/screens/BuildApkScreen.kt:1672— app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.kt:1672-1689 | app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:1080-1097 — 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/webtoapp/ui/screens/BuildApkScreen.kt:1672` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:736— app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:736-753 | app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:1372-1389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateAppScreen.kt:736` 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/webtoapp/ui/screens/CreateAppScreen.kt:735` calls `ifDescriptionsShown` and `app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:1371` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1876— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1876-1893 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2319-2336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1876` it does not close everything it opens, so those exact lines 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/webtoapp/ui/screens/CreateWordPressAppScreen.kt:119— app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:119-136 | app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:173-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:138` calls `importFullProject` and `app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:191` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:42— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:42-59 | app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:44-61 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt` and `app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/shell/ShellMediaContent.kt:42` it does not close everything it opens, so those exact lines 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/webtoapp/core/ai/AiApiClient.kt:888— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:888-902 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1783-1797 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:888` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1781` calls `add` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:886` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:870— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:870-884 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:917-931 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:870` it does not close everything it opens, so those 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1215— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1215-1229 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:348-362 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (15 lines × 2) app/src/main/java/com/webtoapp/core/notification/NotificationFcmManager.kt:208— app/src/main/java/com/webtoapp/core/notification/NotificationFcmManager.kt:208-222 | app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:740-754 — 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 (15 lines × 2) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:446— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:446-460 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:296-310 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/agent/components/MessageBubbles.kt:817— app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:817-831 | app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:1496-1510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/agent/components/MessageBubbles.kt:817` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) app/src/main/java/com/webtoapp/ui/agent/components/ModelPickerDialog.kt:216— app/src/main/java/com/webtoapp/ui/agent/components/ModelPickerDialog.kt:216-230 | app/src/main/java/com/webtoapp/ui/agent/components/ModelPickerDialog.kt:266-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/webtoapp/ui/agent/components/ModelPickerDialog.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 (15 lines × 2) app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:387— app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:387-401 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:443-457 — both copies are in the same file, so extract the 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/webtoapp/ui/components/StatusBarBackground.kt:108— app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:108-122 | app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:187-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:108` 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/webtoapp/ui/screens/CreateGoAppScreen.kt:135— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:135-149 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:128-142 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt` and `app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:135` it does not close everything it opens, so those exact lines 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/webtoapp/ui/shell/ShellPermissionDelegate.kt:663— app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt:663-677 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:745-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/webtoapp/ui/shell/ShellPermissionDelegate.kt:663` 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/webtoapp/ui/shell/ShellWebViewCallbacks.kt:280— app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.kt:280-294 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3292-3306 — 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/webtoapp/ui/shell/ShellWebViewCallbacks.kt:280` 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/webtoapp/core/apkbuilder/ApkBuilder.kt:2550— app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:2550-2565 | app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:2840-2854 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/apkbuilder/ApkBuilder.kt:2550` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Swallowed exception (empty catch) app/src/main/java/com/webtoapp/core/agent/engine/AbortController.kt:14— 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/webtoapp/core/agent/llm/OllamaProvider.kt:48— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/webtoapp/core/agent/llm/GeminiProvider.kt:63— 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/webtoapp/core/agent/llm/AnthropicProvider.kt:54— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/webtoapp/core/agent/mcp/LoopbackHttpServer.kt:57— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/src/main/java/com/webtoapp/core/agent/mcp/LoopbackHttpServer.kt:171— 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/webtoapp/core/ai/AiApiClient.kt:1293— 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/webtoapp/core/ai/AiApiClient.kt:1329— 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/webtoapp/core/apkbuilder/JarSigner.kt:463— 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/webtoapp/core/apkbuilder/ApkBuilder.kt:1381— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Duplicated block (12 lines × 3) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:935— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:935-946 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1017-1028 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1466-1477 — 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/webtoapp/core/ai/AiApiClient.kt:935` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1761— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1761-1772 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1918-1929 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2086-2097 — 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1761` it does not close everything it opens, so those 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/webtoapp/ui/components/NodeExtensionsCard.kt:140— app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt:140-151 | app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt:182-193 | app/src/main/java/com/webtoapp/ui/components/PythonExtensionsCard.kt:140-151 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt` and `app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt:140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:878— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:878-889 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:244-255 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:981-992 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:878` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1403— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1403-1414 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1913-1924 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1993-2004 — 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1403` it does not close everything it opens, so those 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1401` calls `isActionableAnalysisIssue` and `app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1912` 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/webtoapp/ui/shell/ShellMediaContent.kt:260— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:260-271 | app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:508-519 | app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:180-191 — 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/webtoapp/ui/shell/ShellMediaContent.kt:260` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:258` calls `toInt` and `app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:506` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 3) app/src/main/java/com/webtoapp/ui/webview/ServerPreviewOverlays.kt:24— app/src/main/java/com/webtoapp/ui/webview/ServerPreviewOverlays.kt:24-35 | app/src/main/java/com/webtoapp/ui/webview/ServerPreviewOverlays.kt:93-104 | app/src/main/java/com/webtoapp/ui/webview/ServerPreviewOverlays.kt:153-164 — 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/webtoapp/ui/webview/ServerPreviewOverlays.kt:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `state` to `WordPressPreviewState` in one and `PhpAppPreviewState` 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 (12 lines × 3) app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:831— app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:831-842 | app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:702-713 | app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:835-846 — 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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:831` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/screens/CreateGoAppScreen.kt:817— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:817-828 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:733-744 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:795-806 — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:817` 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/webtoapp/core/apkbuilder/ApkBuilder.kt:4010— app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:4010-4029 | app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:762-781 — 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/webtoapp/core/apkbuilder/ApkBuilder.kt:4010` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) app/src/main/java/com/webtoapp/core/background/BackgroundRunService.kt:174— app/src/main/java/com/webtoapp/core/background/BackgroundRunService.kt:174-193 | app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt:161-180 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/background/BackgroundRunService.kt:174` 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/webtoapp/ui/components/LrcEditorDialog.kt:133— app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:133-152 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:197-216 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt` and `app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/components/LrcEditorDialog.kt:133` 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:390— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:390-409 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:855-874 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:390` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:1428— app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:1428-1447 | app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:1587-1606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/AiSettingsScreen.kt:1428` 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1791— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1791-1810 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2234-2253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1791` 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/webtoapp/ui/shell/ShellOverlays.kt:63— app/src/main/java/com/webtoapp/ui/shell/ShellOverlays.kt:63-82 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:4493-4512 — 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/webtoapp/ui/shell/ShellOverlays.kt:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Change coupling: ApkBuilder.kt ↔ ShellWebViewConfig.kt app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1— `app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.kt` change together 86% of the time (37 of the 43 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 37 shared commits counted here, the most recent 3 are `4dd3dcc4` feat: keep web audio playing after the user leaves (#1336); `14520a63` feat: let a page keep access to one chosen folder (#1318); `291a6cce` Let HTML apps handle inbound shares without the upload toast (#1304) — run `git show` on any of them.
Change coupling: ApkConfig.kt ↔ ShellWebViewConfig.kt app/src/main/java/com/webtoapp/core/apkbuilder/ApkConfig.kt:1— `app/src/main/java/com/webtoapp/core/apkbuilder/ApkConfig.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.kt` change together 81% of the time (35 of the 43 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 35 shared commits counted here, the most recent 3 are `4dd3dcc4` feat: keep web audio playing after the user leaves (#1336); `14520a63` feat: let a page keep access to one chosen folder (#1318); `291a6cce` Let HTML apps handle inbound shares without the upload toast (#1304) — run `git show` on any of them.
Change coupling: ApkConfig.kt ↔ EditState.kt app/src/main/java/com/webtoapp/core/apkbuilder/ApkConfig.kt:1— `app/src/main/java/com/webtoapp/core/apkbuilder/ApkConfig.kt` and `app/src/main/java/com/webtoapp/ui/viewmodel/EditState.kt` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `3a14ee1e` feat(editor): replace "hide toolbar" with a positive "Toolbar" master…; `4cebe73b` revert: remove App Lock feature (UI, config chain, runtime) (#494); `7cbd7eb4` fix+feat: notification permission bug, startup wording, and App Lock … — run `git show` on any of them.
Change coupling: ShellDialogs.kt ↔ SplashLauncherActivity.kt app/src/main/java/com/webtoapp/ui/shell/ShellDialogs.kt:1— `app/src/main/java/com/webtoapp/ui/shell/ShellDialogs.kt` and `app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 `2dc30f92` fix(activation): reuse the remembered card at launch instead of deman…; `834cd21e` fix(bitmap): bound all untrusted decodes, fixes oversized-bitmap cras…; `fea612ef` feat(activation): device binding toggle for remote one-time codes (#709) — run `git show` on any of them.
Change coupling: AgentEngine.kt ↔ OpenAiCompatProvider.kt app/src/main/java/com/webtoapp/core/agent/engine/AgentEngine.kt:1— `app/src/main/java/com/webtoapp/core/agent/engine/AgentEngine.kt` and `app/src/main/java/com/webtoapp/core/agent/llm/OpenAiCompatProvider.kt` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 `05900dbe` fix: echo Gemini thought signatures on tool-call turns (#1368); `d49f36c1` fix(agent): repair turn pipeline, follow behavior, and surface app ch…; `f1a8973b` fix(agent): collect LLM stream once per request; cancel in-flight cal… — run `git show` on any of them.
Change coupling: ActivationManager.kt ↔ ShellScreen.kt app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt:1— `app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellScreen.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 `2dc30f92` fix(activation): reuse the remembered card at launch instead of deman…; `01a57e6d` feat(activation): add AES-256-GCM URL encryption for dynamic URL deli…; `e950417a` feat(activation): deliver target URL from verification server (dynami… — run `git show` on any of them.
Duplicated block (12–13 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2422— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2422-2434 | app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:68-79 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2422` it does not close everything it opens, so those 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–13 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt:179— app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt:179-190 | app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt:223-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/webtoapp/core/apkbuilder/ApkTemplate.kt:179` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12–13 lines × 2) app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt:55— app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt:55-67 | shell/src/main/java-overrides/com/webtoapp/core/autostart/BootReceiver.kt:45-56 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt` and `shell/src/main/java-overrides/com/webtoapp/core/autostart/BootReceiver.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 2) app/src/main/java/com/webtoapp/core/webview/PacProxyManager.kt:182— app/src/main/java/com/webtoapp/core/webview/PacProxyManager.kt:182-193 | app/src/main/java/com/webtoapp/core/webview/PacProxyManager.kt:263-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/webview/PacProxyManager.kt:182` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/webtoapp/core/webview/PacProxyManager.kt:179` calls `Builder`, `addProxyRule` and `app/src/main/java/com/webtoapp/core/webview/PacProxyManager.kt:261` 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–13 lines × 2) app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:786— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:786-798 | app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:868-879 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/BgmSelector.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:592— app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:592-603 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:910-922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:592` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/webtoapp/core/ai/AiApiClient.kt:874— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:874-883 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1428-1437 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1758-1767 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:314— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:314-323 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:874-883 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:921-930 — 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/webtoapp/core/apkbuilder/AxmlRebuilder.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 × 3) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:458— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:458-467 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:413-422 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:735-744 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:458` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:2077— app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:2077-2086 | app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:2112-2121 | app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:2153-2162 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:135— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:135-144 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:249-258 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:128-137 — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:719— app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:719-728 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:747-756 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1475-1484 — 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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:719` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
X15 · Unvalidated length from an untrusted reader· Length read from the parsed input is spent without ever being bounded · ×6
Length read from the parsed input is spent without ever being bounded app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2009— `stringCount` is read from the bytes being parsed at line 2001 (`int`), then used to size a `IntArray` at line 2009 — and nowhere in its scope is `stringCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringCount` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2011— `styleCount` is read from the bytes being parsed at line 2002 (`int`), then used to size a `IntArray` at line 2011 — and nowhere in its scope is `styleCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `styleCount` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:71— `stringCount` is read from the bytes being parsed at line 57 (`int`), then used to size a `IntArray` at line 71 — and nowhere in its scope is `stringCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringCount` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:484— `strCount` is read from the bytes being parsed at line 475 (`int`), then used to size a `IntArray` at line 484 — and nowhere in its scope is `strCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `strCount` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:490— `stringCount` is read from the bytes being parsed at line 483 (`int`), then used to size a `IntArray` at line 490 — and nowhere in its scope is `stringCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringCount` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:491— `styleCount` is read from the bytes being parsed at line 484 (`int`), then used to size a `IntArray` at line 491 — and nowhere in its scope is `styleCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `styleCount` against the bytes actually remaining and a maximum the format allows before allocating.
Duplicated block (26 lines × 2) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:232— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:232-257 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:184-209 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (26 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1759— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1759-1784 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2202-2227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1759` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:1239— app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:1239-1264 | app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:1281-1306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:1239` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:103— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:103-128 | app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:87-112 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt` and `app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/shell/ShellMediaContent.kt:103` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (26 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:273— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:273-298 | app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:193-218 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt` and `app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/shell/ShellMediaContent.kt:273` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 2) app/src/main/java/com/webtoapp/core/agent/engine/AgentEngine.kt:356— app/src/main/java/com/webtoapp/core/agent/engine/AgentEngine.kt:356-373 | app/src/main/java/com/webtoapp/core/agent/engine/AgentEngine.kt:378-396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/agent/engine/AgentEngine.kt:356` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:72— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:72-90 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:182-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/webtoapp/core/ai/AiApiClient.kt:72` it begins part-way through the construct above it, so those 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 `apiKey` to `ApiKeyConfig): Result<Boolean> = withContext(Dispatchers.IO` in one and `ApiKeyConfig): Result<List<AiModel>> = withContext(Dispatchers.IO` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:71` calls `header` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:181` 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 × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:966— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:966-984 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:416-433 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:966` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–19 lines × 2) app/src/main/java/com/webtoapp/ui/components/AppNameTextField.kt:30— app/src/main/java/com/webtoapp/ui/components/AppNameTextField.kt:30-47 | app/src/main/java/com/webtoapp/ui/components/AppNameTextField.kt:60-78 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/AppNameTextField.kt:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18–19 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:887— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:887-905 | app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:387-404 — 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:887` it begins part-way through the construct above it, so those exact lines 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/webtoapp/WebToAppApplication.kt:146— app/src/main/java/com/webtoapp/WebToAppApplication.kt:146-161 | shell/src/main/java-overrides/com/webtoapp/WebToAppApplication.kt:93-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (16–17 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:58— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:58-74 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:162-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:58` it does not close everything it opens, so those 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 `apiKey` to `ApiKeyConfig): Result<Boolean> = withContext(Dispatchers.IO` in one and `ApiKeyConfig): Result<List<AiModel>> = withContext(Dispatchers.IO` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (16–17 lines × 2) app/src/main/java/com/webtoapp/ui/components/EnhancedActivationDialog.kt:411— app/src/main/java/com/webtoapp/ui/components/EnhancedActivationDialog.kt:411-427 | app/src/main/java/com/webtoapp/ui/components/LanguageSelector.kt:463-478 — 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/webtoapp/ui/components/EnhancedActivationDialog.kt:411` 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:335— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:335-351 | app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:882-897 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:446— app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:446-461 | app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:469-485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/ModuleMarketScreen.kt:446` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1331— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1331-1345 | app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:65-79 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:119-133 — 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/webtoapp/ui/components/BgmSelector.kt:1331` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:313— app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:313-327 | app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:387-401 | app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:500-514 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:313` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:372— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:372-386 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:495-509 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:476-490 — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:372` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 3) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:228— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:228-242 | app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:481-495 | app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:147-161 — 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/webtoapp/ui/shell/ShellMediaContent.kt:228` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:371— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:371-385 | app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:402-416 | app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:421-435 — 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/webtoapp/ui/shell/ShellMediaContent.kt:371` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) app/src/main/java/com/webtoapp/core/crypto/AesCryptoEngine.kt:81— app/src/main/java/com/webtoapp/core/crypto/AesCryptoEngine.kt:81-95 | app/src/main/java/com/webtoapp/core/crypto/AesCryptoEngine.kt:139-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/crypto/AesCryptoEngine.kt:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:93— app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:93-107 | app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:173-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/StatusBarBackground.kt:93` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14–15 lines × 2) app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.kt:679— app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.kt:679-693 | app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.kt:1239-1252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/BuildApkScreen.kt:679` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:168— app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:168-182 | app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:271-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:168` it does not close everything it opens, so those exact lines 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/webtoapp/ui/screens/ModuleMarketScreen.kt:296— app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:296-309 | app/src/main/java/com/webtoapp/ui/screens/PluginManagerScreen.kt:160-174 — 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/webtoapp/ui/screens/ModuleMarketScreen.kt:296` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2456— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2456-2466 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:728-737 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `output` to `ByteArrayOutputStream` in one and `java.io.ByteArrayOutputStream` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10–11 lines × 2) app/src/main/java/com/webtoapp/ui/agent/components/AgentDrawer.kt:327— app/src/main/java/com/webtoapp/ui/agent/components/AgentDrawer.kt:327-337 | app/src/main/java/com/webtoapp/ui/agent/components/AgentDrawer.kt:525-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/webtoapp/ui/agent/components/AgentDrawer.kt:327` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:614— app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:614-623 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:933-943 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/ManualLrcAligner.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:623` calls `formatTime` and `app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:943` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 2) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:754— app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:754-763 | app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:1389-1399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/AiSettingsScreen.kt:754` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:763` calls `padding` and `app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:1399` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:142— app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:142-152 | app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:193-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateWordPressAppScreen.kt:142` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Low cohesion: ApkTemplate (LCOM4 5) app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt:11— ApkTemplate's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: GoRuntime (LCOM4 4) app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:24— GoRuntime's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PhpAppRuntime (LCOM4 4) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:22— PhpAppRuntime's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PythonRuntime (LCOM4 4) app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:23— PythonRuntime's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: LongPressHandler (LCOM4 4) app/src/main/java/com/webtoapp/core/webview/LongPressHandler.kt:29— LongPressHandler'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.
Change-coupling hub: ApkConfigJsonFactory.kt → ShellModeManager.kt, ShellWebViewConfig.kt, EditState.kt app/src/main/java/com/webtoapp/core/apkbuilder/ApkConfigJsonFactory.kt— `app/src/main/java/com/webtoapp/core/apkbuilder/ApkConfigJsonFactory.kt` changes together with 3 other files — `app/src/main/java/com/webtoapp/core/shell/ShellModeManager.kt`, `app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.kt`, `app/src/main/java/com/webtoapp/ui/viewmodel/EditState.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: Strings.kt → ActivationManager.kt, ApkBuildCache.kt, ApkBuilder.kt, ApkConfig.kt, ApkConfigJsonFactory.kt, StringsA.kt, StringsB.kt, StringsC.kt, ShellModeManager.kt, WebApp.kt, AgentScreen.kt, AgentUiState.kt, ActivationCodeCard.kt, AppNavigation.kt, BuildApkScreen.kt, CreateAppApkSection.kt, CreateAppScreen.kt, CreateAppWebViewCards.kt, CreateHtmlAppScreen.kt, CreateMultiWebAppScreen.kt, HomeScreen.kt, ModuleMarketScreen.kt, ShellDialogs.kt, ShellScaffoldLayout.kt, ShellWebViewConfig.kt, EditState.kt app/src/main/java/com/webtoapp/core/i18n/Strings.kt— `app/src/main/java/com/webtoapp/core/i18n/Strings.kt` changes together with 26 other files — `app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt`, `app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuildCache.kt`, `app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt`, `app/src/main/java/com/webtoapp/core/apkbuilder/ApkConfig.kt`, `app/src/main/java/com/webtoapp/core/apkbuilder/ApkConfigJsonFactory.kt`, `app/src/main/java/com/webtoapp/core/i18n/StringsA.kt`, `app/src/main/java/com/webtoapp/core/i18n/StringsB.kt`, `app/src/main/java/com/webtoapp/core/i18n/StringsC.kt`, `app/src/main/java/com/webtoapp/core/shell/ShellModeManager.kt`, `app/src/main/java/com/webtoapp/data/model/WebApp.kt`, `app/src/main/java/com/webtoapp/ui/agent/AgentScreen.kt`, `app/src/main/java/com/webtoapp/ui/agent/AgentUiState.kt`, `app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt`, `app/src/main/java/com/webtoapp/ui/navigation/AppNavigation.kt`, `app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.kt`, `app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.kt`, `app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt`, `app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt`, `app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt`, `app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt`, `app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt`, `app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt`, `app/src/main/java/com/webtoapp/ui/shell/ShellDialogs.kt`, `app/src/main/java/com/webtoapp/ui/shell/ShellScaffoldLayout.kt`, `app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.kt`, `app/src/main/java/com/webtoapp/ui/viewmodel/EditState.kt` — none of which declares a dependency on it: one file is the hub of 26 separate couplings, not 26 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 26.
Change-coupling hub: WebViewActivity.kt → ShellDialogs.kt, ShellPermissionDelegate.kt, ShellWebViewCallbacks.kt, ShellWebViewConfig.kt, SplashLauncherActivity.kt app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt— `app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt` changes together with 5 other files — `app/src/main/java/com/webtoapp/ui/shell/ShellDialogs.kt`, `app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt`, `app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.kt`, `app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.kt`, `app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.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: CreateAppWebViewCards.kt → ApkConfig.kt, ApkConfigJsonFactory.kt, ShellModeManager.kt, ShellScaffoldLayout.kt, ShellWebViewConfig.kt app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt— `app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt` changes together with 5 other files — `app/src/main/java/com/webtoapp/core/apkbuilder/ApkConfig.kt`, `app/src/main/java/com/webtoapp/core/apkbuilder/ApkConfigJsonFactory.kt`, `app/src/main/java/com/webtoapp/core/shell/ShellModeManager.kt`, `app/src/main/java/com/webtoapp/ui/shell/ShellScaffoldLayout.kt`, `app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.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.
Duplicated block (25 lines × 2) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:494— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:494-518 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:344-368 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/php/PhpAppRuntime.kt:494` it does not close everything it opens, so those 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/webtoapp/core/php/PhpAppRuntime.kt:520` calls `toString`, `trim` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:370` 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/webtoapp/ui/components/PhpExtensionsCard.kt:81— app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt:81-105 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:920-944 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt` and `app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) app/src/main/java/com/webtoapp/ui/design/WtaDisplay.kt:131— app/src/main/java/com/webtoapp/ui/design/WtaDisplay.kt:131-155 | app/src/main/java/com/webtoapp/ui/design/WtaDisplay.kt:185-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/design/WtaDisplay.kt:131` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 2) app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:1149— app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:1149-1173 | app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:1205-1229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:418— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:418-438 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:373-393 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:418` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1182— app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1182-1202 | app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1424-1444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/ActivationCodeCard.kt:1182` it does not close everything it opens, so those exact lines 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1821— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1821-1841 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2264-2284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1821` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) app/src/main/java/com/webtoapp/ui/theme/ThemeAnimations.kt:30— app/src/main/java/com/webtoapp/ui/theme/ThemeAnimations.kt:30-50 | app/src/main/java/com/webtoapp/ui/theme/ThemeAnimations.kt:53-73 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16–18 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1823— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1823-1838 | app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:164-181 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt` as WHOLE FILES: this scan already matched 7 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/ai/AiApiClient.kt:1823` 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/webtoapp/core/ai/provider/AiResponseParser.kt:163` calls `Suppress` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1822` 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–18 lines × 2) app/src/main/java/com/webtoapp/core/frontend/SampleProjectManager.kt:125— app/src/main/java/com/webtoapp/core/frontend/SampleProjectManager.kt:125-142 | app/src/main/java/com/webtoapp/core/sample/SampleProjectExtractor.kt:105-120 — 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/webtoapp/core/frontend/SampleProjectManager.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/core/sample/SampleProjectExtractor.kt:122` calls `supplementHiddenAssetsFromApk`, `toSet` and `app/src/main/java/com/webtoapp/core/frontend/SampleProjectManager.kt:143` 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–18 lines × 2) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:265— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:265-282 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:340-355 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:265` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–18 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellScreen.kt:452— app/src/main/java/com/webtoapp/ui/shell/ShellScreen.kt:452-469 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3361-3376 — 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/webtoapp/ui/shell/ShellScreen.kt:452` it does not close everything it opens, so those exact lines 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/webtoapp/core/ai/AiApiClient.kt:655— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:655-665 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:829-839 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1693-1703 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2391-2401 — 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/webtoapp/core/ai/AiApiClient.kt:655` it begins part-way through the construct above it, so those 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 (11 lines × 4) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:332— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:332-342 | app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:879-889 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:245-255 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:982-992 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:332` it does not close everything it opens, so those exact lines 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/webtoapp/ui/screens/CreateFrontendAppScreen.kt:676— app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:676-686 | app/src/main/java/com/webtoapp/ui/screens/WordPressSettingsScreen.kt:84-94 | app/src/main/java/com/webtoapp/ui/screens/WordPressSettingsScreen.kt:115-125 | app/src/main/java/com/webtoapp/ui/screens/WordPressSettingsScreen.kt:193-203 — 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/webtoapp/ui/screens/CreateFrontendAppScreen.kt:676` it does not close everything it opens, so those 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/webtoapp/ui/screens/CreateFrontendAppScreen.kt:674` calls `BuildModeSelector` and `app/src/main/java/com/webtoapp/ui/screens/WordPressSettingsScreen.kt:113` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 4) app/src/main/java/com/webtoapp/core/shell/ShellServerLauncher.kt:80— app/src/main/java/com/webtoapp/core/shell/ShellServerLauncher.kt:80-90 | app/src/main/java/com/webtoapp/core/shell/ShellServerLauncher.kt:134-144 | app/src/main/java/com/webtoapp/core/shell/ShellServerLauncher.kt:192-202 | app/src/main/java/com/webtoapp/core/shell/ShellServerLauncher.kt:252-262 — 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/webtoapp/core/shell/ShellServerLauncher.kt:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) app/src/main/java/com/webtoapp/ui/agent/components/AgentDrawer.kt:221— app/src/main/java/com/webtoapp/ui/agent/components/AgentDrawer.kt:221-231 | app/src/main/java/com/webtoapp/ui/agent/components/AgentDrawer.kt:236-246 | app/src/main/java/com/webtoapp/ui/agent/components/AgentDrawer.kt:249-259 — 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/webtoapp/ui/agent/components/AgentDrawer.kt:221` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/agent/components/ModelPickerDialog.kt:213— app/src/main/java/com/webtoapp/ui/agent/components/ModelPickerDialog.kt:213-223 | app/src/main/java/com/webtoapp/ui/agent/components/ModelPickerDialog.kt:263-273 | app/src/main/java/com/webtoapp/ui/agent/components/SaveAsAppDialog.kt:191-201 — 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/webtoapp/ui/agent/components/ModelPickerDialog.kt:213` it does not close everything it opens, so those exact lines 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/webtoapp/ui/screens/CreateGoAppScreen.kt:512— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:512-522 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:626-636 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:620-630 — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:512` it begins part-way through the construct above it, so those exact lines 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/webtoapp/core/engine/GeckoViewEngine.kt:1056— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1056-1066 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1143-1153 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1236-1246 — 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/webtoapp/core/engine/GeckoViewEngine.kt:1056` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 3) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1044— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1044-1051 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1401-1408 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1439-1446 — 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/webtoapp/core/engine/GeckoViewEngine.kt:1044` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:483— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:483-490 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:464-471 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:757-764 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:483` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt:553— app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt:553-560 | REDACTED:114-121 | clone-host/src/main/java/com/webtoapp/clone/CloneLauncherActivity.kt:505-512 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:2087— app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:2087-2094 | app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:2122-2129 | app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:2163-2170 — 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/webtoapp/core/webview/NativeBridge.kt:2087` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:857— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:857-864 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:525-531 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7–8 lines × 2) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:4042— app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:4042-4049 | app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:4075-4081 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/webview/WebViewManager.kt:4042` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1322— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1322-1328 | app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:54-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7–8 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:229— app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:229-236 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:577-583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Deprecated module: github.com/gofiber/fiber/v2 — `github.com/gofiber/fiber/v2` is required at v2.52.0 in REDACTED, and its author has DEPRECATED the module: "Fiber v2 has been superseded by Fiber v3; use github.com/gofiber/fiber/v3 instead." A deprecation is declared by the author in the module's own REDACTED and applies to the whole module, not to one release, so moving to a newer version of it does not clear this. Follow the replacement the notice names.
Deprecated module: github.com/gofiber/fiber/v2 — `github.com/gofiber/fiber/v2` is required at v2.52.0 in app/src/main/assets/sample_projects/go-fiber-en/go.mod, and its author has DEPRECATED the module: "Fiber v2 has been superseded by Fiber v3; use github.com/gofiber/fiber/v3 instead." A deprecation is declared by the author in the module's own REDACTED and applies to the whole module, not to one release, so moving to a newer version of it does not clear this. Follow the replacement the notice names.
Deprecated module: github.com/gofiber/fiber/v2 — `github.com/gofiber/fiber/v2` is required at v2.52.0 in app/src/main/assets/sample_projects/go-fiber/go.mod, and its author has DEPRECATED the module: "Fiber v2 has been superseded by Fiber v3; use github.com/gofiber/fiber/v3 instead." A deprecation is declared by the author in the module's own REDACTED and applies to the whole module, not to one release, so moving to a newer version of it does not clear this. Follow the replacement the notice names.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:264— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:264-293 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:295-331 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:852-892 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:894-950 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:518-563 — 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/webtoapp/core/golang/GoRuntime.kt:357— app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:357-377 | app/src/main/java/com/webtoapp/core/nodejs/NodeRuntime.kt:252-273 | app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:279-299 | app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:452-472 | app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:474-491 — 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/webtoapp/ui/screens/CreateFrontendAppScreen.kt:66— app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:66-671 | app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:64-402 | app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:1506-1767 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:116-1394 | app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:57-536 — 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.
Duplicated block (28 lines × 2) app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:702— app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:702-729 | app/src/main/java/com/webtoapp/ui/shell/ConsolePanel.kt:287-314 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt` and `app/src/main/java/com/webtoapp/ui/shell/ConsolePanel.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:702` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:758— app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:758-785 | app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:882-909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:758` it does not close everything it opens, so those exact lines 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:572— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:572-599 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:675-702 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:572` it does not close everything it opens, so those exact lines 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/webtoapp/core/webview/LocalHttpToSocksBridge.kt:106— app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:106-127 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:179-200 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt` and `app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt` as WHOLE FILES: this scan already matched 7 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:175` calls `stop` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:102` 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 (22 lines × 2) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:662— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:662-683 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:732-753 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:662` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/shell/ShellScreen.kt:473— app/src/main/java/com/webtoapp/ui/shell/ShellScreen.kt:473-494 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3380-3401 — 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/webtoapp/ui/shell/ShellScreen.kt:473` 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–20 lines × 2) app/src/main/java/com/webtoapp/ui/components/SampleProjectCard.kt:212— app/src/main/java/com/webtoapp/ui/components/SampleProjectCard.kt:212-231 | app/src/main/java/com/webtoapp/ui/components/TypedSampleProjectCard.kt:39-57 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/SampleProjectCard.kt` and `app/src/main/java/com/webtoapp/ui/components/TypedSampleProjectCard.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/components/SampleProjectCard.kt:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 2) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:629— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:629-648 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:711-729 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:629` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:707` calls `delay` and `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:625` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19–20 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:940— app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:940-959 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:3451-3469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateAppWebViewCards.kt:940` 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/webtoapp/core/ai/AiApiClient.kt:1711— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1711-1729 | app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:101-119 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt` as WHOLE FILES: this scan already matched 7 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/ai/AiApiClient.kt:1711` it does not close everything it opens, so those 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/webtoapp/core/ai/provider/AiResponseParser.kt:120` calls `Suppress` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1730` 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 (19 lines × 2) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:385— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:385-403 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:340-358 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 2) app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:488— app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:488-506 | app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:154-172 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt` and `app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:488` 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 × 3) app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt:153— app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt:153-168 | app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt:195-210 | app/src/main/java/com/webtoapp/ui/components/PythonExtensionsCard.kt:153-168 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt` and `app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt:153` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 3) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:492— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:492-507 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:606-621 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:595-610 — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:492` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 3) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:98— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:98-113 | app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:417-432 | app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:82-97 — 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/webtoapp/ui/shell/ShellMediaContent.kt:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–16 lines × 2) app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1224— app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1224-1239 | app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1458-1470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/ActivationCodeCard.kt:1224` it begins part-way through the construct above it, so those 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–16 lines × 2) app/src/main/java/com/webtoapp/ui/components/OnlineMusicSearchDialog.kt:827— app/src/main/java/com/webtoapp/ui/components/OnlineMusicSearchDialog.kt:827-842 | app/src/main/java/com/webtoapp/ui/components/OnlineMusicSearchDialog.kt:1033-1045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/OnlineMusicSearchDialog.kt:827` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–16 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:301— app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:301-316 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:1278-1290 — 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 × 3) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:817— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:817-830 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1398-1411 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1681-1694 — 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/webtoapp/core/ai/AiApiClient.kt:817` 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/webtoapp/core/background/BackgroundRunService.kt:175— app/src/main/java/com/webtoapp/core/background/BackgroundRunService.kt:175-188 | app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt:162-175 | app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:228-241 — 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/webtoapp/core/background/BackgroundRunService.kt:175` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 3) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:118— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:118-131 | app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:436-449 | app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:102-115 — 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/webtoapp/ui/shell/ShellMediaContent.kt:118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1197— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1197-1209 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:260-272 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:330-342 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (13 lines × 3) app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt:175— app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt:175-187 | app/src/main/java/com/webtoapp/ui/shell/ShellActivityInit.kt:150-162 | shell/src/main/java-overrides/com/webtoapp/core/autostart/BootReceiver.kt:141-153 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt` and `shell/src/main/java-overrides/com/webtoapp/core/autostart/BootReceiver.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/autostart/BootReceiver.kt:175` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/ui/shell/ShellActivityInit.kt:163` calls `i` and `app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt:188` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 3) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:333— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:333-345 | app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:880-892 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:983-995 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:333` 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/webtoapp/core/apkbuilder/ApkTemplate.kt:257— app/src/main/java/com/webtoapp/core/apkbuilder/ApkTemplate.kt:257-268 | app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:693-702 — 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/webtoapp/core/apkbuilder/ApkTemplate.kt:257` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10–12 lines × 2) app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3989— app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:3989-3998 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:4122-4133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/webview/WebViewActivity.kt:3989` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) app/src/main/java/com/webtoapp/util/DownloadHelper.kt:193— app/src/main/java/com/webtoapp/util/DownloadHelper.kt:193-204 | app/src/main/java/com/webtoapp/util/DownloadHelper.kt:293-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/util/DownloadHelper.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 4) app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:127— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:127-136 | app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1332-1341 | app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:66-75 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:120-129 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:127` it does not close everything it opens, so those exact lines 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 × 4) app/src/main/java/com/webtoapp/ui/components/IconGeneratorDialog.kt:82— app/src/main/java/com/webtoapp/ui/components/IconGeneratorDialog.kt:82-91 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1405-1414 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1915-1924 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1995-2004 — 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/webtoapp/ui/components/IconGeneratorDialog.kt:82` it does not close everything it opens, so those 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1401` calls `isActionableAnalysisIssue` and `app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1912` 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 × 4) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:411— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:411-420 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:506-515 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:524-533 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:520-529 — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:411` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2282— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2282-2291 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:649-657 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:1025— app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:1025-1033 | app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:1047-1056 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateWordPressAppScreen.kt:1025` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) app/src/main/java/com/webtoapp/util/DownloadHelper.kt:168— app/src/main/java/com/webtoapp/util/DownloadHelper.kt:168-177 | app/src/main/java/com/webtoapp/util/DownloadHelper.kt:180-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/util/DownloadHelper.kt:168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 5) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:879— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:879-887 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:936-944 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1018-1026 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1433-1441 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1467-1475 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:879` 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/webtoapp/core/ai/AiApiClient.kt:1444` calls `addProperty` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:890` 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 × 5) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:279— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:279-287 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:312-320 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:872-880 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:919-927 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:540-548 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 5) app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:1279— app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:1279-1288 | app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:678-686 | app/src/main/java/com/webtoapp/ui/screens/WordPressSettingsScreen.kt:86-94 | app/src/main/java/com/webtoapp/ui/screens/WordPressSettingsScreen.kt:117-125 | app/src/main/java/com/webtoapp/ui/screens/WordPressSettingsScreen.kt:195-203 — 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/webtoapp/ui/screens/CreateAppScreen.kt:1279` it begins part-way through the construct above it, so those 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/webtoapp/ui/screens/WordPressSettingsScreen.kt:84` calls `EnhancedElevatedCard`, `fillMaxWidth`, `Column` and `app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:1279` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 4) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:127— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:127-131 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:763-768 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1535-1539 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2312-2316 — 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/webtoapp/core/ai/AiApiClient.kt:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:382— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:382-386 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:470-478 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:505-509 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:486-490 — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:382` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 4) app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:585— app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:585-590 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:738-742 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:860-864 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:1044-1048 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:318— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:318-325 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:255-262 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:656-660 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:753— app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:753-757 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:778-782 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:818-826 — 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/webtoapp/ui/screens/CreatePhpAppScreen.kt:753` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:93— app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:93-97 | REDACTED:173-177 | app/src/main/java/com/webtoapp/core/wordpress/WordPressDependencyManager.kt:127-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
content_script.pageWorldSetup::bodyToBase64 (cyclomatic 18) app/src/main/assets/web_extensions/wta_native_bridge/content_script.js:125— content_script.pageWorldSetup::bodyToBase64 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. This shape REPEATS in the file: 2 other methods here (content_script.pageWorldSetup, content_script.pageWorldSetup::isPrivateHost) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
content_script.pageWorldSetup::isPrivateHost (cyclomatic 18) app/src/main/assets/web_extensions/wta_native_bridge/content_script.js:169— content_script.pageWorldSetup::isPrivateHost has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: 2 other methods here (content_script.pageWorldSetup, content_script.pageWorldSetup::bodyToBase64) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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/webtoapp/ui/components/IconLibraryDialog.kt:39— app/src/main/java/com/webtoapp/ui/components/IconLibraryDialog.kt:39-267 | app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:1255-1351 | app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:675-724 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1646-1904 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2089-2347 | app/src/main/java/com/webtoapp/ui/screens/WordPressSettingsScreen.kt:36-248 — 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/webtoapp/ui/shell/ShellServerModes.kt:43— app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:43-184 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:584-722 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:737-844 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:859-1028 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:1043-1179 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:1195-1351 — 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.
Duplicated block (32 lines × 2) app/src/main/java/com/webtoapp/ui/components/SampleProjectCard.kt:353— app/src/main/java/com/webtoapp/ui/components/SampleProjectCard.kt:353-384 | app/src/main/java/com/webtoapp/ui/components/TypedSampleProjectCard.kt:174-205 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/SampleProjectCard.kt` and `app/src/main/java/com/webtoapp/ui/components/TypedSampleProjectCard.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/components/SampleProjectCard.kt:353` it does not close everything it opens, so those exact lines 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/webtoapp/ui/screens/ModuleMarketScreen.kt:806— app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:806-837 | app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:858-889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/ModuleMarketScreen.kt:806` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1059— app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1059-1088 | app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1106-1135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/apkbuilder/ApkBuilder.kt:1059` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30 lines × 2) app/src/main/java/com/webtoapp/core/extension/ExtensionModule.kt:393— app/src/main/java/com/webtoapp/core/extension/ExtensionModule.kt:393-422 | app/src/main/java/com/webtoapp/core/plugin/PluginModels.kt:233-262 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (27 lines × 2) app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:892— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:892-918 | app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:928-954 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/BgmSelector.kt:892` it does not close everything it opens, so those 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/webtoapp/ui/components/BgmSelector.kt:955` calls `size` and `app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:919` 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 (27 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:874— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:874-900 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:1053-1079 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt` and `app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:874` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–22 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:987— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:987-1008 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:384-404 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–22 lines × 2) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:334— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:334-355 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:272-292 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:334` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20–21 lines × 2) app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:409— app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:409-428 | app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:73-93 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt` and `app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:409` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20–21 lines × 2) app/src/main/java/com/webtoapp/util/DownloadHelper.kt:461— app/src/main/java/com/webtoapp/util/DownloadHelper.kt:461-480 | app/src/main/java/com/webtoapp/util/DownloadHelper.kt:534-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/util/DownloadHelper.kt:461` it does not close everything it opens, so those exact lines 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–19 lines × 2) app/src/main/java/com/webtoapp/ui/agent/components/AppChangesReviewCard.kt:63— app/src/main/java/com/webtoapp/ui/agent/components/AppChangesReviewCard.kt:63-79 | app/src/main/java/com/webtoapp/ui/agent/components/ChangesReviewCard.kt:66-84 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/agent/components/AppChangesReviewCard.kt` and `app/src/main/java/com/webtoapp/ui/agent/components/ChangesReviewCard.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/agent/components/AppChangesReviewCard.kt:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–19 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:893— app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:893-911 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:1043-1059 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:893` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–16 lines × 2) app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt:81— app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt:81-96 | shell/src/main/java-overrides/com/webtoapp/core/autostart/BootReceiver.kt:57-70 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt` and `shell/src/main/java-overrides/com/webtoapp/core/autostart/BootReceiver.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/autostart/BootReceiver.kt:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–16 lines × 2) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:296— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:296-311 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:369-382 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt` and `app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:296` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–15 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1318— app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1318-1332 | app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:719-730 — 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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1318` it does not close everything it opens, so those exact lines 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–15 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt:331— app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt:331-345 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:460-471 — 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/webtoapp/ui/shell/ShellPermissionDelegate.kt:331` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–14 lines × 2) app/src/main/java/com/webtoapp/core/agent/runtime/AgentService.kt:423— app/src/main/java/com/webtoapp/core/agent/runtime/AgentService.kt:423-435 | app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuildService.kt:92-105 — 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/webtoapp/core/agent/runtime/AgentService.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.
Duplicated block (13–14 lines × 2) app/src/main/java/com/webtoapp/ui/components/PluginPickerCard.kt:58— app/src/main/java/com/webtoapp/ui/components/PluginPickerCard.kt:58-71 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:461-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/PluginPickerCard.kt:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1470— app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1470-1482 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:606-616 — 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/webtoapp/ui/components/BgmSelector.kt:1470` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:1382— app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:1382-1394 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:1592-1602 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11–12 lines × 2) app/src/main/java/com/webtoapp/core/agent/tool/builtin/GlobTool.kt:48— app/src/main/java/com/webtoapp/core/agent/tool/builtin/GlobTool.kt:48-59 | app/src/main/java/com/webtoapp/core/agent/tool/builtin/GrepTool.kt:112-122 — 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/webtoapp/core/agent/tool/builtin/GlobTool.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 (11–12 lines × 2) app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:689— app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:689-700 | app/src/main/java/com/webtoapp/ui/shell/ConsolePanel.kt:276-286 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt` and `app/src/main/java/com/webtoapp/ui/shell/ConsolePanel.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:689` it does not close everything it opens, so those 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–10 lines × 2) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1048— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1048-1055 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1077-1086 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/engine/GeckoViewEngine.kt:1048` it does not close everything it opens, so those exact lines 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–10 lines × 2) app/src/main/java/com/webtoapp/ui/components/SampleProjectCard.kt:57— app/src/main/java/com/webtoapp/ui/components/SampleProjectCard.kt:57-66 | app/src/main/java/com/webtoapp/ui/components/SampleProjectCard.kt:80-87 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/SampleProjectCard.kt:57` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 3) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:1036— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:1036-1044 | app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:656-666 | app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:1339-1347 — 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:1036` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/screens/HostsAdBlockScreen.kt:793— app/src/main/java/com/webtoapp/ui/screens/HostsAdBlockScreen.kt:793-801 | app/src/main/java/com/webtoapp/ui/screens/RuntimeDepsScreen.kt:693-701 | app/src/main/java/com/webtoapp/ui/screens/StatsScreen.kt:740-748 — 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 (7–9 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2144— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2144-2152 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:572-578 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2144` it begins part-way through the construct above it, so those exact lines 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–9 lines × 2) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1141— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1141-1147 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1232-1240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1141` it begins part-way through the construct above it, so those exact lines 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/webtoapp/ui/agent/AgentViewModel.kt:2011— app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt:2011-2018 | app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt:2026-2034 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/agent/AgentViewModel.kt:2011` it does not close everything it opens, so those 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–9 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt:626— app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt:626-633 | app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt:893-901 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt:626` 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 × 4) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:516— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:516-522 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:946-952 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:630-636 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:624-630 — 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/webtoapp/ui/screens/CreateGoAppScreen.kt:516` it does not close everything it opens, so those exact lines 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 × 4) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:492— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:492-498 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:473-479 | app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:308-314 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:766-772 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:70— app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:70-75 | app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:1513-1518 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:125-130 | app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:63-68 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:76` calls `rememberCoroutineScope`, `rememberScrollState` and `app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:1520` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 4) app/src/main/java/com/webtoapp/core/agent/session/AttachmentNote.kt:50— app/src/main/java/com/webtoapp/core/agent/session/AttachmentNote.kt:50-55 | app/src/main/java/com/webtoapp/core/agent/tool/builtin/ReadFileTool.kt:81-86 | app/src/main/java/com/webtoapp/core/agent/tool/builtin/imagery/ViewImageTool.kt:90-95 | app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt:2221-2226 — 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 (6 lines × 3) app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:368— app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:368-373 | app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:459-464 | app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:481-486 — 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/webtoapp/core/golang/GoRuntime.kt:368` it begins part-way through the construct above it, so those exact lines 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/webtoapp/core/php/PhpAppRuntime.kt:479— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:479-484 | app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:437-443 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:329-334 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/php/PhpAppRuntime.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.
WebViewActivityKt.WebViewScreen (cyclomatic 424) app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:1618— WebViewActivityKt.WebViewScreen has cyclomatic complexity 424 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WebViewManager.createWebViewClient (cyclomatic 224) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:2267— WebViewManager.createWebViewClient has cyclomatic complexity 224 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CreateHtmlAppScreenKt.CreateHtmlAppScreen (cyclomatic 125) app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:94— CreateHtmlAppScreenKt.CreateHtmlAppScreen has cyclomatic complexity 125 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ShellScreenKt.ShellScreen (cyclomatic 114) app/src/main/java/com/webtoapp/ui/shell/ShellScreen.kt:50— ShellScreenKt.ShellScreen has cyclomatic complexity 114 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CreateNodeJsAppScreenKt.CreateNodeJsAppScreen (cyclomatic 102) app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:53— CreateNodeJsAppScreenKt.CreateNodeJsAppScreen has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ApkBuilder.modifyApk (cyclomatic 99) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1441— ApkBuilder.modifyApk has cyclomatic complexity 99 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WebViewManager.configureWebView (cyclomatic 93) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:1465— WebViewManager.configureWebView 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.
ApkBuilder.buildApkInternal (cyclomatic 89) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:420— ApkBuilder.buildApkInternal has cyclomatic complexity 89 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HomeScreenKt.HomeScreen (cyclomatic 84) app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:118— HomeScreenKt.HomeScreen has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StringsA.njsFrameworkTips (cyclomatic 81) app/src/main/java/com/webtoapp/core/i18n/StringsA.kt:3013— StringsA.njsFrameworkTips has cyclomatic complexity 81 (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.
BuildApkScreenKt.BuildApkContent (cyclomatic 81) app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.kt:136— BuildApkScreenKt.BuildApkContent has cyclomatic complexity 81 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CreatePythonAppScreenKt.CreatePythonAppScreen (cyclomatic 73) app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:49— CreatePythonAppScreenKt.CreatePythonAppScreen has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AiApiClient.inferInputPrice (cyclomatic 66) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:511— AiApiClient.inferInputPrice has cyclomatic complexity 66 (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.
AiApiClient.inferContextLength (cyclomatic 65) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:434— AiApiClient.inferContextLength has cyclomatic complexity 65 (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.
StringsD.goFrameworkTip (cyclomatic 61) app/src/main/java/com/webtoapp/core/i18n/StringsD.kt:8307— StringsD.goFrameworkTip has cyclomatic complexity 61 (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.
MultiWebShellModeKt.TabsMode (cyclomatic 60) app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt:245— MultiWebShellModeKt.TabsMode has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AiApiClient.chatStream (cyclomatic 59) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1104— AiApiClient.chatStream 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.
AgentEngine.run (cyclomatic 55) app/src/main/java/com/webtoapp/core/agent/engine/AgentEngine.kt:50— AgentEngine.run has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AiApiClient.chatStreamWithTools (cyclomatic 55) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1840— AiApiClient.chatStreamWithTools has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CreatePhpAppScreenKt.CreatePhpAppScreen (cyclomatic 55) app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:61— CreatePhpAppScreenKt.CreatePhpAppScreen has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileManagerScreenKt.FileManagerScreen (cyclomatic 54) app/src/main/java/com/webtoapp/ui/screens/FileManagerScreen.kt:146— FileManagerScreenKt.FileManagerScreen has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ShellActivity.onCreate (cyclomatic 52) app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:489— ShellActivity.onCreate has cyclomatic complexity 52 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OnlineMusicSearchDialogKt.OnlineMusicSearchDialog (cyclomatic 51) app/src/main/java/com/webtoapp/ui/components/OnlineMusicSearchDialog.kt:72— OnlineMusicSearchDialogKt.OnlineMusicSearchDialog has cyclomatic complexity 51 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CreateFrontendAppScreenKt.CreateFrontendAppScreen (cyclomatic 49) app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:55— CreateFrontendAppScreenKt.CreateFrontendAppScreen has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RuntimeDepsScreenKt.RuntimeDepsScreen (cyclomatic 49) app/src/main/java/com/webtoapp/ui/screens/RuntimeDepsScreen.kt:138— RuntimeDepsScreenKt.RuntimeDepsScreen has cyclomatic complexity 49 (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.
generate_submissions._resolve_for_path (cyclomatic 48) .github/scripts/ci/generate_submissions.py:303— generate_submissions._resolve_for_path has cyclomatic complexity 48 (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.
ArscRebuilder.findIconPathIndices (cyclomatic 44) app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:301— ArscRebuilder.findIconPathIndices has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HomeScreenKt.AppCard (cyclomatic 44) app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:1318— HomeScreenKt.AppCard has cyclomatic complexity 44 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
StaticAssetScraper.scrape (cyclomatic 43) app/src/main/java/com/webtoapp/core/scraper/StaticAssetScraper.kt:130— StaticAssetScraper.scrape 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.
LanguageSelectorKt.FirstLaunchLanguageScreen (cyclomatic 43) app/src/main/java/com/webtoapp/ui/components/LanguageSelector.kt:213— LanguageSelectorKt.FirstLaunchLanguageScreen has cyclomatic complexity 43 (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.
NodeDependencyManager.patchElfPageSize (cyclomatic 42) app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:657— NodeDependencyManager.patchElfPageSize 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.
ShellWebViewConfigKt.buildWebViewConfig (cyclomatic 42) app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.kt:8— ShellWebViewConfigKt.buildWebViewConfig has cyclomatic complexity 42 (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.
GeckoViewEngine.setupPromptDelegate (cyclomatic 41) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1013— GeckoViewEngine.setupPromptDelegate has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CreateGoAppScreenKt.CreateGoAppScreen (cyclomatic 40) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:48— CreateGoAppScreenKt.CreateGoAppScreen 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.
RuntimePermissionSyncKt.enableFrom (cyclomatic 39) app/src/main/java/com/webtoapp/data/model/RuntimePermissionSync.kt:3— RuntimePermissionSyncKt.enableFrom has cyclomatic complexity 39 (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.
CreateMultiWebAppScreenKt.CreateMultiWebAppScreen (cyclomatic 39) app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt:64— CreateMultiWebAppScreenKt.CreateMultiWebAppScreen 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.
ApkRuntimePermissions.manualBeyond (cyclomatic 38) app/src/main/java/com/webtoapp/data/model/WebApp.kt:1506— ApkRuntimePermissions.manualBeyond has cyclomatic complexity 38 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
WtaCodeEditorDialogKt.WtaCodeEditorDialog (cyclomatic 38) app/src/main/java/com/webtoapp/ui/components/WtaCodeEditorDialog.kt:71— WtaCodeEditorDialogKt.WtaCodeEditorDialog 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.
php_router_server.executePHP (cyclomatic 38) app/src/main/assets/php_router_server.php:421— php_router_server.executePHP has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CreateWordPressAppScreenKt.CreateWordPressAppScreen (cyclomatic 37) app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:57— CreateWordPressAppScreenKt.CreateWordPressAppScreen 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.
ShellMediaContentKt.ShellSplashOverlay (cyclomatic 36) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:24— ShellMediaContentKt.ShellSplashOverlay 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.
AdBlocker.generateScriptlet (cyclomatic 35) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:2090— AdBlocker.generateScriptlet 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.
ApkToAabAssembler.assemble (cyclomatic 35) app/src/main/java/com/webtoapp/core/playstore/aab/ApkToAabAssembler.kt:35— ApkToAabAssembler.assemble 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.
PluginImporter.parseMeta (cyclomatic 35) app/src/main/java/com/webtoapp/core/plugin/PluginImporter.kt:160— PluginImporter.parseMeta 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.
LinuxEnvironmentScreenKt.ReadinessHero (cyclomatic 35) app/src/main/java/com/webtoapp/ui/screens/LinuxEnvironmentScreen.kt:392— LinuxEnvironmentScreenKt.ReadinessHero 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.
ShellGalleryKt.ShellGalleryPlayer (cyclomatic 35) app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:50— ShellGalleryKt.ShellGalleryPlayer 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.
AgentViewModel.handleAgentEvent (cyclomatic 34) app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt:1800— AgentViewModel.handleAgentEvent has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BgmSelectorKt.BgmSelectorDialog (cyclomatic 34) app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:53— BgmSelectorKt.BgmSelectorDialog has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CreateMediaAppScreenKt.CreateMediaAppScreen (cyclomatic 34) app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:46— CreateMediaAppScreenKt.CreateMediaAppScreen has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ShellWebViewCallbacksKt.createShellWebViewCallbacks (cyclomatic 34) app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.kt:31— ShellWebViewCallbacksKt.createShellWebViewCallbacks has cyclomatic complexity 34 (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.
content_script.pageWorldSetup (cyclomatic 34) app/src/main/assets/web_extensions/wta_share/content_script.js:31— content_script.pageWorldSetup has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 10 of the 34 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 96, a function literal at line 36, shareFiles, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
UserScriptParser.parse (cyclomatic 33) app/src/main/java/com/webtoapp/core/extension/UserScriptParser.kt:24— UserScriptParser.parse 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.
MessageBubblesKt.SpecialToolBody (cyclomatic 33) app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:938— MessageBubblesKt.SpecialToolBody 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.
AiSettingsScreenKt.AddModelDialog (cyclomatic 33) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:1138— AiSettingsScreenKt.AddModelDialog 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.
PluginManagerScreenKt.PluginManagerScreen (cyclomatic 33) app/src/main/java/com/webtoapp/ui/screens/PluginManagerScreen.kt:53— PluginManagerScreenKt.PluginManagerScreen has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DependencyDownloadEngine.downloadFileEx (cyclomatic 32) app/src/main/java/com/webtoapp/core/download/DependencyDownloadEngine.kt:201— DependencyDownloadEngine.downloadFileEx has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StringsA.screenAwakeTimeoutValue (cyclomatic 32) app/src/main/java/com/webtoapp/core/i18n/StringsA.kt:7115— StringsA.screenAwakeTimeoutValue has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeBridge.httpRequest (cyclomatic 32) app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:1447— NativeBridge.httpRequest has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StringsD.pyFrameworkTip (cyclomatic 31) app/src/main/java/com/webtoapp/core/i18n/StringsD.kt:7954— StringsD.pyFrameworkTip has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ManualLrcAlignerKt.ManualLrcAlignerDialog (cyclomatic 31) app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:45— ManualLrcAlignerKt.ManualLrcAlignerDialog 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.
CreateOfflinePackScreenKt.CreateOfflinePackScreen (cyclomatic 31) app/src/main/java/com/webtoapp/ui/screens/CreateOfflinePackScreen.kt:29— CreateOfflinePackScreenKt.CreateOfflinePackScreen 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.
PortManagerScreenKt.PortManagerScreen (cyclomatic 31) app/src/main/java/com/webtoapp/ui/screens/PortManagerScreen.kt:108— PortManagerScreenKt.PortManagerScreen 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.
generate_shell_strings.mask_code (cyclomatic 31) scripts/generate_shell_strings.py:41— generate_shell_strings.mask_code 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.
content_script.pageWorldSetup (cyclomatic 31) app/src/main/assets/web_extensions/wta_native_bridge/content_script.js:91— content_script.pageWorldSetup has cyclomatic complexity 31 (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. This shape REPEATS in the file: 2 other methods here (content_script.pageWorldSetup::bodyToBase64, content_script.pageWorldSetup::isPrivateHost) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BrowserDisguiseConfig.calculateCoverage (cyclomatic 30) app/src/main/java/com/webtoapp/core/appearance/DisguiseConfig.kt:253— BrowserDisguiseConfig.calculateCoverage has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppCloner.modifyApk (cyclomatic 30) app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:392— AppCloner.modifyApk 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.
TlsMitmBridge.handleConnectCronet (cyclomatic 30) app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:369— TlsMitmBridge.handleConnectCronet 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.
WebViewManager.injectScripts (cyclomatic 30) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:4899— WebViewManager.injectScripts has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: WebViewManager.inferResourceType (cyclomatic 31) 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.
WindowHelper.applyImmersiveFullscreen (cyclomatic 30) app/src/main/java/com/webtoapp/ui/shared/WindowHelper.kt:120— WindowHelper.applyImmersiveFullscreen 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.
WebViewActivity.onCreate (cyclomatic 30) app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:933— WebViewActivity.onCreate has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: WebViewActivity.extensionToMimeTypeForChooser (cyclomatic 38) 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.
ApkBuildCache.isContentReplaceableEntry (cyclomatic 29) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuildCache.kt:292— ApkBuildCache.isContentReplaceableEntry 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.
PythonRuntime.startServer (cyclomatic 29) app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:75— PythonRuntime.startServer 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.
WebsiteScraper.discoverResources (cyclomatic 29) REDACTED:383— WebsiteScraper.discoverResources 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.
InstallProjectDepsCardKt.InstallProjectDepsCard (cyclomatic 29) app/src/main/java/com/webtoapp/ui/screens/InstallProjectDepsCard.kt:43— InstallProjectDepsCardKt.InstallProjectDepsCard has cyclomatic complexity 29 (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.
ModuleMarketScreenKt.ModuleMarketScreen (cyclomatic 29) app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:103— ModuleMarketScreenKt.ModuleMarketScreen 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.
ApkBuilder.addPythonAppFilesToAssets (cyclomatic 28) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:2879— ApkBuilder.addPythonAppFilesToAssets has cyclomatic complexity 28 (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.
ChromeExtensionParser.parseFromDirectory (cyclomatic 28) app/src/main/java/com/webtoapp/core/extension/ChromeExtensionParser.kt:56— ChromeExtensionParser.parseFromDirectory 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.
CreateAppApkSectionKt.CustomSigningSection (cyclomatic 28) app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.kt:721— CreateAppApkSectionKt.CustomSigningSection 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.
CreateAppUserScriptsKt.UserScriptEditorDialog (cyclomatic 28) app/src/main/java/com/webtoapp/ui/screens/CreateAppUserScripts.kt:149— CreateAppUserScriptsKt.UserScriptEditorDialog 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.
ShellBrowserViewKt.ShellBrowserAndroidView (cyclomatic 28) app/src/main/java/com/webtoapp/ui/shell/ShellBrowserView.kt:22— ShellBrowserViewKt.ShellBrowserAndroidView 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.
AutoStartCardKt.AutoStartCard (cyclomatic 27) app/src/main/java/com/webtoapp/ui/components/AutoStartCard.kt:36— AutoStartCardKt.AutoStartCard has cyclomatic complexity 27 (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.
GalleryPlayerScreenKt.GalleryPlayerScreen (cyclomatic 27) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:51— GalleryPlayerScreenKt.GalleryPlayerScreen 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.
ShellGalleryKt.ShellGalleryVideoPlayer (cyclomatic 27) app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:542— ShellGalleryKt.ShellGalleryVideoPlayer 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.
ShellScaffoldLayoutKt.ShellScaffoldLayout (cyclomatic 27) app/src/main/java/com/webtoapp/ui/shell/ShellScaffoldLayout.kt:41— ShellScaffoldLayoutKt.ShellScaffoldLayout 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.
SplashLauncherActivityKt.SplashLauncherScreen (cyclomatic 27) app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:110— SplashLauncherActivityKt.SplashLauncherScreen 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.
generate_submissions.main (cyclomatic 27) .github/scripts/ci/generate_submissions.py:527— generate_submissions.main 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.
validate_modules._validate_registry_entry (cyclomatic 27) .github/scripts/ci/validate_modules.py:184— validate_modules._validate_registry_entry 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.
GrepTool.execute (cyclomatic 26) app/src/main/java/com/webtoapp/core/agent/tool/builtin/GrepTool.kt:34— GrepTool.execute 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.
BatchImportService.parseTextDetailed (cyclomatic 26) app/src/main/java/com/webtoapp/core/stats/BatchImportService.kt:47— BatchImportService.parseTextDetailed 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.
WebViewManager.refetchWithHeaderModifications (cyclomatic 26) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3690— WebViewManager.refetchWithHeaderModifications 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. This is NOT this file's highest cyclomatic complexity: WebViewManager.inferResourceType (cyclomatic 31) 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.
BrowserDisguiseConfigCardKt.BrowserDisguiseConfigCard (cyclomatic 26) app/src/main/java/com/webtoapp/ui/components/BrowserDisguiseConfigCard.kt:34— BrowserDisguiseConfigCardKt.BrowserDisguiseConfigCard has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentService.persistEvent (cyclomatic 25) app/src/main/java/com/webtoapp/core/agent/runtime/AgentService.kt:206— AgentService.persistEvent 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.
HostsAdBlockScreenKt.HostsAdBlockScreen (cyclomatic 25) app/src/main/java/com/webtoapp/ui/screens/HostsAdBlockScreen.kt:93— HostsAdBlockScreenKt.HostsAdBlockScreen 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.
PlayStoreScreenKt.PlayStoreScreen (cyclomatic 25) app/src/main/java/com/webtoapp/ui/screens/PlayStoreScreen.kt:93— PlayStoreScreenKt.PlayStoreScreen 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.
AdBlocker.parseNetworkFilter (cyclomatic 24) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:1843— AdBlocker.parseNetworkFilter 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.
ApkBuilder.addHtmlFilesToAssets (cyclomatic 24) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3271— ApkBuilder.addHtmlFilesToAssets 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.
LocalHttpServer.start (cyclomatic 24) app/src/main/java/com/webtoapp/core/webview/LocalHttpServer.kt:107— LocalHttpServer.start has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: LocalHttpServer.getMimeType (cyclomatic 29) 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.
MessageBubblesKt.ToolCallCard (cyclomatic 24) app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:702— MessageBubblesKt.ToolCallCard 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. This is NOT this file's highest cyclomatic complexity: MessageBubblesKt.languageFor (cyclomatic 32) 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.
BrowserDisguiseConfigCardKt.countActiveVectors (cyclomatic 24) app/src/main/java/com/webtoapp/ui/components/BrowserDisguiseConfigCard.kt:564— BrowserDisguiseConfigCardKt.countActiveVectors 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.
CreateAppScreenKt.BasicInfoCard (cyclomatic 24) app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:838— CreateAppScreenKt.BasicInfoCard 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.
HtmlProjectHelper.processAndSaveFiles (cyclomatic 24) app/src/main/java/com/webtoapp/util/HtmlProjectHelper.kt:22— HtmlProjectHelper.processAndSaveFiles 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.
ApkBuilder.requiresNetworkPermissions (cyclomatic 23) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3981— ApkBuilder.requiresNetworkPermissions 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.
BrowserDisguiseEngine.countActiveVectors (cyclomatic 23) app/src/main/java/com/webtoapp/core/appearance/BrowserDisguiseEngine.kt:93— BrowserDisguiseEngine.countActiveVectors 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.
ChromeExtensionRuntimeKt.performNativeFetch (cyclomatic 23) app/src/main/java/com/webtoapp/core/extension/ChromeExtensionRuntime.kt:921— ChromeExtensionRuntimeKt.performNativeFetch 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.
ProjectDetector.detectRuntimeRequirement (cyclomatic 23) app/src/main/java/com/webtoapp/core/frontend/ProjectDetector.kt:324— ProjectDetector.detectRuntimeRequirement 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.
HtmlProjectOptimizer.optimizeDirectory (cyclomatic 23) app/src/main/java/com/webtoapp/core/linux/HtmlProjectOptimizer.kt:94— HtmlProjectOptimizer.optimizeDirectory 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.
PythonRuntime.detectFramework (cyclomatic 23) app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:372— PythonRuntime.detectFramework 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.
WebViewManager.handleSpecialUrl (cyclomatic 23) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:4233— WebViewManager.handleSpecialUrl has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: WebViewManager.inferResourceType (cyclomatic 31) 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.
AgentScreenKt.Conversation (cyclomatic 23) app/src/main/java/com/webtoapp/ui/agent/AgentScreen.kt:540— AgentScreenKt.Conversation 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.
MarkdownTextKt.inlineAnnotated (cyclomatic 23) app/src/main/java/com/webtoapp/ui/agent/components/MarkdownText.kt:329— MarkdownTextKt.inlineAnnotated 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.
OnlineMusicSearchDialogKt.OnlineMusicTrackItem (cyclomatic 23) app/src/main/java/com/webtoapp/ui/components/OnlineMusicSearchDialog.kt:786— OnlineMusicSearchDialogKt.OnlineMusicTrackItem 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.
AppAccentPalettes.scheme (cyclomatic 23) app/src/main/java/com/webtoapp/ui/theme/AppAccent.kt:315— AppAccentPalettes.scheme 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.
NetworkErrorDiagnostics.diagnose (cyclomatic 22) app/src/main/java/com/webtoapp/core/errorpage/NetworkErrorDiagnostics.kt:22— NetworkErrorDiagnostics.diagnose 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.
ElfInterpPatcher.currentInterp (cyclomatic 22) app/src/main/java/com/webtoapp/core/python/ElfInterpPatcher.kt:77— ElfInterpPatcher.currentInterp 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.
ElfInterpPatcher.rewriteInterp (cyclomatic 22) app/src/main/java/com/webtoapp/core/python/ElfInterpPatcher.kt:134— ElfInterpPatcher.rewriteInterp 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.
WebViewManager.createWebChromeClient (cyclomatic 22) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3950— WebViewManager.createWebChromeClient 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. This is NOT this file's highest cyclomatic complexity: WebViewManager.inferResourceType (cyclomatic 31) 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.
StatusBarImageCropperKt.StatusBarImageCropper (cyclomatic 22) app/src/main/java/com/webtoapp/ui/components/StatusBarImageCropper.kt:40— StatusBarImageCropperKt.StatusBarImageCropper 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.
CreateGalleryAppScreenKt.CreateGalleryAppScreenV2 (cyclomatic 22) app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:1497— CreateGalleryAppScreenKt.CreateGalleryAppScreenV2 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.
MainViewModel.applyPwaResult (cyclomatic 22) app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:303— MainViewModel.applyPwaResult has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
server.server (cyclomatic 22) app/src/main/assets/sample_projects/nodejs-koa/server.js:25— server.server 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.
CreateAppTool.createFromSource (cyclomatic 21) app/src/main/java/com/webtoapp/core/agent/tool/builtin/CreateAppTool.kt:116— CreateAppTool.createFromSource has cyclomatic complexity 21 (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.
JarSigner.importKeystore (cyclomatic 21) app/src/main/java/com/webtoapp/core/apkbuilder/JarSigner.kt:689— JarSigner.importKeystore 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.
ProjectDirCleaner.deleteForApp (cyclomatic 21) app/src/main/java/com/webtoapp/core/app/ProjectDirCleaner.kt:36— ProjectDirCleaner.deleteForApp has cyclomatic complexity 21 (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.
DeviceDisguiseConfig.generateUserAgent (cyclomatic 21) app/src/main/java/com/webtoapp/core/appearance/DeviceDisguiseConfig.kt:43— DeviceDisguiseConfig.generateUserAgent has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: DeviceDisguiseConfig.getDefaultModel (cyclomatic 30) 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.
RuntimeProtection.detectFrida (cyclomatic 21) app/src/main/java/com/webtoapp/core/crypto/RuntimeProtection.kt:200— RuntimeProtection.detectFrida has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
LocalBuildEnvironment.detectToolVersion (cyclomatic 21) app/src/main/java/com/webtoapp/core/linux/LocalBuildEnvironment.kt:526— LocalBuildEnvironment.detectToolVersion 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.
NodeService.handleStartServer (cyclomatic 21) app/src/main/java/com/webtoapp/core/nodejs/NodeService.kt:162— NodeService.handleStartServer 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.
LegacyProxyFetchBridge.intercept (cyclomatic 21) app/src/main/java/com/webtoapp/core/webview/LegacyProxyFetchBridge.kt:216— LegacyProxyFetchBridge.intercept 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.
WebViewManager.injectCompatibilityScripts (cyclomatic 21) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:5156— WebViewManager.injectCompatibilityScripts 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. This is NOT this file's highest cyclomatic complexity: WebViewManager.inferResourceType (cyclomatic 31) 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.
IsolationConfigCardKt.ScreenPicker (cyclomatic 21) app/src/main/java/com/webtoapp/ui/components/IsolationConfigCard.kt:568— IsolationConfigCardKt.ScreenPicker has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
GalleryPlayerScreenKt.GalleryVideoPlayer (cyclomatic 21) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:508— GalleryPlayerScreenKt.GalleryVideoPlayer 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.
ShellServerModesKt.HtmlFrontendShellMode (cyclomatic 21) app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:187— ShellServerModesKt.HtmlFrontendShellMode 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.
ProjectFileManager.scanLines (cyclomatic 20) app/src/main/java/com/webtoapp/core/agent/files/ProjectFileManager.kt:126— ProjectFileManager.scanLines 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.
OpenAiCompatProvider.executeCall (cyclomatic 20) app/src/main/java/com/webtoapp/core/agent/llm/OpenAiCompatProvider.kt:48— OpenAiCompatProvider.executeCall 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.
AiApiClient.buildOpenAIStreamWithToolsRequest (cyclomatic 20) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2203— AiApiClient.buildOpenAIStreamWithToolsRequest 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.
ApkExportPreflight.toBuildInputPreflightRequest (cyclomatic 20) app/src/main/java/com/webtoapp/core/apkbuilder/ApkExportPreflight.kt:67— ApkExportPreflight.toBuildInputPreflightRequest 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.
AxmlRebuilder.rewriteSaepPolicyMetadata (cyclomatic 20) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1661— AxmlRebuilder.rewriteSaepPolicyMetadata 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.
DataBackupManager.collectAppResources (cyclomatic 20) app/src/main/java/com/webtoapp/core/backup/DataBackupManager.kt:731— DataBackupManager.collectAppResources 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.
GoRuntime.startServer (cyclomatic 20) app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:93— GoRuntime.startServer 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.
LocalNetworkPermission.isPrivateNetworkHost (cyclomatic 20) app/src/main/java/com/webtoapp/core/webview/LocalNetworkPermission.kt:39— LocalNetworkPermission.isPrivateNetworkHost 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.
NativeBridge.isPrivateNetworkHost (cyclomatic 20) app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:538— NativeBridge.isPrivateNetworkHost 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.
ExportPermissionCatalogKt.withExportGrant (cyclomatic 20) app/src/main/java/com/webtoapp/data/model/ExportPermissionCatalog.kt:513— ExportPermissionCatalogKt.withExportGrant 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.
AgentScreenKt.AgentScreen (cyclomatic 20) app/src/main/java/com/webtoapp/ui/agent/AgentScreen.kt:123— AgentScreenKt.AgentScreen 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.
IconPickerWithLibraryKt.IconPickerWithLibrary (cyclomatic 20) app/src/main/java/com/webtoapp/ui/components/IconPickerWithLibrary.kt:34— IconPickerWithLibraryKt.IconPickerWithLibrary 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.
AppNavigationKt.AppNavigation (cyclomatic 20) app/src/main/java/com/webtoapp/ui/navigation/AppNavigation.kt:156— AppNavigationKt.AppNavigation 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.
AiSettingsScreenKt.AiSettingsScreen (cyclomatic 20) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:50— AiSettingsScreenKt.AiSettingsScreen 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.
AiSettingsScreenKt.AddApiKeyDialog (cyclomatic 20) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:821— AiSettingsScreenKt.AddApiKeyDialog 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.
AppModifierScreenKt.AppModifyContent (cyclomatic 20) app/src/main/java/com/webtoapp/ui/screens/AppModifierScreen.kt:568— AppModifierScreenKt.AppModifyContent 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.
ConfigTemplateMenuButtonKt.ConfigTemplateMenuButton (cyclomatic 20) app/src/main/java/com/webtoapp/ui/screens/ConfigTemplateMenuButton.kt:57— ConfigTemplateMenuButtonKt.ConfigTemplateMenuButton 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.
ShellMediaContentKt.MediaContentDisplay (cyclomatic 20) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:301— ShellMediaContentKt.MediaContentDisplay 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.
ShellServerModesKt.ServerAppShellMode (cyclomatic 20) app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:1182— ShellServerModesKt.ServerAppShellMode 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.
WebViewActivity.launchFileChooserIntent (cyclomatic 20) app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:522— WebViewActivity.launchFileChooserIntent has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: WebViewActivity.extensionToMimeTypeForChooser (cyclomatic 38) 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.
WebViewSplashOverlayKt.SplashOverlay (cyclomatic 20) app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:30— WebViewSplashOverlayKt.SplashOverlay 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.
AnthropicProvider.chatStream (cyclomatic 19) app/src/main/java/com/webtoapp/core/agent/llm/AnthropicProvider.kt:25— AnthropicProvider.chatStream 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.
ApkArtifactVerifier.verify (cyclomatic 19) app/src/main/java/com/webtoapp/core/apkbuilder/ApkArtifactVerifier.kt:47— ApkArtifactVerifier.verify 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.
ApkBuilder.addBgmToAssets (cyclomatic 19) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3155— ApkBuilder.addBgmToAssets 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.
ApkBuilder.isComplexHtmlProject (cyclomatic 19) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3419— ApkBuilder.isComplexHtmlProject 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.
DataBackupManager.importAllData (cyclomatic 19) app/src/main/java/com/webtoapp/core/backup/DataBackupManager.kt:329— DataBackupManager.importAllData has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
GeckoViewEngine.createView (cyclomatic 19) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:804— GeckoViewEngine.createView 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.
GeckoViewEngine.setupPermissionDelegate (cyclomatic 19) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:2131— GeckoViewEngine.setupPermissionDelegate 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.
ProjectDetector.detectFramework (cyclomatic 19) app/src/main/java/com/webtoapp/core/frontend/ProjectDetector.kt:223— ProjectDetector.detectFramework 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.
PhpAppRuntime.startServer (cyclomatic 19) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:69— PhpAppRuntime.startServer 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.
ArscToProtoTable.convertSimpleValue (cyclomatic 19) app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscToProtoTable.kt:169— ArscToProtoTable.convertSimpleValue 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.
PythonRuntime.waitForServerReady (cyclomatic 19) app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:796— PythonRuntime.waitForServerReady 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.
ApkUpdateInstaller.streamToFile (cyclomatic 19) app/src/main/java/com/webtoapp/core/update/ApkUpdateInstaller.kt:165— ApkUpdateInstaller.streamToFile 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.
MessageBubblesKt.MessageBubble (cyclomatic 19) app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:159— MessageBubblesKt.MessageBubble 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. This is NOT this file's highest cyclomatic complexity: MessageBubblesKt.languageFor (cyclomatic 32) 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.
VideoTrimmerKt.VideoTrimmer (cyclomatic 19) app/src/main/java/com/webtoapp/ui/components/VideoTrimmer.kt:30— VideoTrimmerKt.VideoTrimmer 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.
CreateMultiWebAppScreenKt.ExistingAppPicker (cyclomatic 19) app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt:599— CreateMultiWebAppScreenKt.ExistingAppPicker 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.
HostsAdBlockScreenKt.HostsSourceCard (cyclomatic 19) app/src/main/java/com/webtoapp/ui/screens/HostsAdBlockScreen.kt:658— HostsAdBlockScreenKt.HostsSourceCard has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
NodeJsProjectImportAnalyzer.analyze (cyclomatic 19) app/src/main/java/com/webtoapp/ui/screens/create/runtime/NodeJsProjectImportAnalyzer.kt:35— NodeJsProjectImportAnalyzer.analyze 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.
ShellBgmPlayerKt.rememberBgmPlayerState (cyclomatic 19) app/src/main/java/com/webtoapp/ui/shell/ShellBgmPlayer.kt:321— ShellBgmPlayerKt.rememberBgmPlayerState 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.
ShellPermissionDelegate.launchFileChooserIntent (cyclomatic 19) app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt:354— ShellPermissionDelegate.launchFileChooserIntent 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.
ShellStartupPermissions.buildSpecialQueue (cyclomatic 19) app/src/main/java/com/webtoapp/ui/shell/ShellStartupPermissions.kt:128— ShellStartupPermissions.buildSpecialQueue has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SplashLauncherActivityKt.SplashContent (cyclomatic 19) app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:365— SplashLauncherActivityKt.SplashContent 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.
AdBlocker.parseProceduralSelector (cyclomatic 18) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:1759— AdBlocker.parseProceduralSelector 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.
OllamaProvider.chatStream (cyclomatic 18) app/src/main/java/com/webtoapp/core/agent/llm/OllamaProvider.kt:22— OllamaProvider.chatStream 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.
ResponsesProvider.chatStream (cyclomatic 18) app/src/main/java/com/webtoapp/core/agent/llm/ResponsesProvider.kt:35— ResponsesProvider.chatStream has cyclomatic complexity 18 (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.
ApkBuilder.isEditorOnlyAsset (cyclomatic 18) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3803— ApkBuilder.isEditorOnlyAsset 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.
ArscRebuilder.rebuildWithNewAppNameAndIcons (cyclomatic 18) app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:29— ArscRebuilder.rebuildWithNewAppNameAndIcons 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.
JarSigner.trySignWithRetry (cyclomatic 18) app/src/main/java/com/webtoapp/core/apkbuilder/JarSigner.kt:1157— JarSigner.trySignWithRetry 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.
GeckoEngineDownloader.download (cyclomatic 18) app/src/main/java/com/webtoapp/core/engine/download/GeckoEngineDownloader.kt:52— GeckoEngineDownloader.download 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.
GreasemonkeyBridge.xmlHttpRequest (cyclomatic 18) app/src/main/java/com/webtoapp/core/extension/GreasemonkeyBridge.kt:280— GreasemonkeyBridge.xmlHttpRequest 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.
AxmlToProtoXml.compileValue (cyclomatic 18) app/src/main/java/com/webtoapp/core/playstore/aab/axml/AxmlToProtoXml.kt:87— AxmlToProtoXml.compileValue has cyclomatic complexity 18 (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.
AxmlToProtoXml.formatRawValue (cyclomatic 18) app/src/main/java/com/webtoapp/core/playstore/aab/axml/AxmlToProtoXml.kt:248— AxmlToProtoXml.formatRawValue has cyclomatic complexity 18 (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.
LocalHttpServer.handleClient (cyclomatic 18) app/src/main/java/com/webtoapp/core/webview/LocalHttpServer.kt:254— LocalHttpServer.handleClient has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: LocalHttpServer.getMimeType (cyclomatic 29) 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.
RuntimePermissionSyncKt.featurePermissionReasons (cyclomatic 18) app/src/main/java/com/webtoapp/data/model/RuntimePermissionSync.kt:188— RuntimePermissionSyncKt.featurePermissionReasons 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.
MessageBubblesKt.RichAssistantTimeline (cyclomatic 18) app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:551— MessageBubblesKt.RichAssistantTimeline has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: MessageBubblesKt.languageFor (cyclomatic 32) 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.
HtmlPreviewActivityKt.HtmlPreviewScreen (cyclomatic 18) app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:83— HtmlPreviewActivityKt.HtmlPreviewScreen 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.
BgmCardKt.BgmCard (cyclomatic 18) app/src/main/java/com/webtoapp/ui/components/BgmCard.kt:31— BgmCardKt.BgmCard 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.
ModelCatalogSectionKt.ModelCatalogSection (cyclomatic 18) app/src/main/java/com/webtoapp/ui/screens/ModelCatalogSection.kt:67— ModelCatalogSectionKt.ModelCatalogSection has cyclomatic complexity 18 (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.
ShellActivity.onNewIntent (cyclomatic 18) app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:1089— ShellActivity.onNewIntent 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.
MainViewModel.saveMultiWebApp (cyclomatic 18) app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:1131— MainViewModel.saveMultiWebApp 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.
generate_shell_strings._find_member_end (cyclomatic 18) scripts/generate_shell_strings.py:214— generate_shell_strings._find_member_end 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.
content_script.isPrivateHost (cyclomatic 18) app/src/main/assets/web_extensions/wta_native_bridge/content_script.js:17— content_script.isPrivateHost has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AdBlocker.inferResourceTypeFromRequest (cyclomatic 17) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:982— AdBlocker.inferResourceTypeFromRequest has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
McpDispatcher.handleObject (cyclomatic 17) app/src/main/java/com/webtoapp/core/agent/mcp/McpDispatcher.kt:42— McpDispatcher.handleObject has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PreviewTool.execute (cyclomatic 17) app/src/main/java/com/webtoapp/core/agent/tool/builtin/PreviewTool.kt:56— PreviewTool.execute 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.
AiApiClient.testConnection (cyclomatic 17) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:49— AiApiClient.testConnection has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
BuildInputPreflight.requireMultiWebSites (cyclomatic 17) app/src/main/java/com/webtoapp/core/apkbuilder/BuildInputPreflight.kt:279— BuildInputPreflight.requireMultiWebSites has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DeclarativeNetRequestEngine.matchesRule (cyclomatic 17) app/src/main/java/com/webtoapp/core/extension/DeclarativeNetRequestEngine.kt:439— DeclarativeNetRequestEngine.matchesRule 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.
GoDirectBuilder.buildPackage (cyclomatic 17) app/src/main/java/com/webtoapp/core/golang/GoDirectBuilder.kt:384— GoDirectBuilder.buildPackage 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.
GoRuntime.detectFramework (cyclomatic 17) app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:316— GoRuntime.detectFramework 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.
IsolationScriptInjector.generateIsolationScript (cyclomatic 17) app/src/main/java/com/webtoapp/core/privacy/IsolationScriptInjector.kt:5— IsolationScriptInjector.generateIsolationScript 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.
PythonDependencyManager.extractTarGz (cyclomatic 17) REDACTED:1224— PythonDependencyManager.extractTarGz 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.
RuntimePermissionSyncKt.featureRequiredRuntimePermissions (cyclomatic 17) app/src/main/java/com/webtoapp/data/model/RuntimePermissionSync.kt:46— RuntimePermissionSyncKt.featureRequiredRuntimePermissions 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.
MainActivity.onCreate (cyclomatic 17) app/src/main/java/com/webtoapp/ui/MainActivity.kt:65— MainActivity.onCreate 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.
EnhancedActivationDialogKt.ActivationDialogHeader (cyclomatic 17) app/src/main/java/com/webtoapp/ui/components/EnhancedActivationDialog.kt:177— EnhancedActivationDialogKt.ActivationDialogHeader has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
IsolationConfigCardKt.IsolationConfigCard (cyclomatic 17) app/src/main/java/com/webtoapp/ui/components/IsolationConfigCard.kt:37— IsolationConfigCardKt.IsolationConfigCard 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.
LrcEditorDialogKt.LrcEditorDialog (cyclomatic 17) app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:39— LrcEditorDialogKt.LrcEditorDialog 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.
WtaSwipeBackKt.WtaSwipeBackContainer (cyclomatic 17) app/src/main/java/com/webtoapp/ui/design/WtaSwipeBack.kt:33— WtaSwipeBackKt.WtaSwipeBackContainer 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.
AiSettingsScreenKt.SavedModelItem (cyclomatic 17) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:592— AiSettingsScreenKt.SavedModelItem 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.
CreateGalleryAppScreenKt.CreateGalleryAppScreen (cyclomatic 17) app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:55— CreateGalleryAppScreenKt.CreateGalleryAppScreen 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.
CreateGoAppScreenKt.GoBinaryDetectionCard (cyclomatic 17) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:610— CreateGoAppScreenKt.GoBinaryDetectionCard has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PythonProjectImportAnalyzer.detectFramework (cyclomatic 17) app/src/main/java/com/webtoapp/ui/screens/create/runtime/PythonProjectImportAnalyzer.kt:73— PythonProjectImportAnalyzer.detectFramework has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ZoomableStateKt.zoomableGesture (cyclomatic 17) app/src/main/java/com/webtoapp/ui/shared/ZoomableState.kt:140— ZoomableStateKt.zoomableGesture 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.
ShellServerModesKt.PythonAppShellMode (cyclomatic 17) app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:847— ShellServerModesKt.PythonAppShellMode 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.
HtmlProjectProcessor.analyzeProject (cyclomatic 17) app/src/main/java/com/webtoapp/util/HtmlProjectProcessor.kt:102— HtmlProjectProcessor.analyzeProject 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.
audit_ui_design_system.main (cyclomatic 17) .github/scripts/audit_ui_design_system.py:169— audit_ui_design_system.main 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.
validate_modules._validate_plugin_json (cyclomatic 17) .github/scripts/ci/validate_modules.py:502— validate_modules._validate_plugin_json 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.
AdBlocker.matchesNetworkFilter (cyclomatic 16) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:2038— AdBlocker.matchesNetworkFilter 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.
ApkBuilder.addHtmlFilesPreserveStructure (cyclomatic 16) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3494— ApkBuilder.addHtmlFilesPreserveStructure 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.
ArscRebuilder.findLauncherBackgroundEntry (cyclomatic 16) app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:180— ArscRebuilder.findLauncherBackgroundEntry 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.
AxmlRebuilder.mergeManifestFragment (cyclomatic 16) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1342— AxmlRebuilder.mergeManifestFragment 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.
DataBackupManager.stageLocalBackupEntry (cyclomatic 16) app/src/main/java/com/webtoapp/core/backup/DataBackupManager.kt:1116— DataBackupManager.stageLocalBackupEntry 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.
FloatingWindowService.onStartCommand (cyclomatic 16) app/src/main/java/com/webtoapp/core/floatingwindow/FloatingWindowService.kt:85— FloatingWindowService.onStartCommand 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.
AppLogger.log (cyclomatic 16) app/src/main/java/com/webtoapp/core/logging/AppLogger.kt:337— AppLogger.log 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.
PhpAppRuntime.detectFramework (cyclomatic 16) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:301— PhpAppRuntime.detectFramework 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.
WordPressPhpRuntime.startServer (cyclomatic 16) app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:59— WordPressPhpRuntime.startServer 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.
MarkdownTextKt.parseMarkdownBlocks (cyclomatic 16) app/src/main/java/com/webtoapp/ui/agent/components/MarkdownText.kt:248— MarkdownTextKt.parseMarkdownBlocks 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.
ManualLrcAlignerKt.AlignmentStep (cyclomatic 16) app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:513— ManualLrcAlignerKt.AlignmentStep 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.
ManualLrcAlignerKt.AlignmentLineItem (cyclomatic 16) app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:743— ManualLrcAlignerKt.AlignmentLineItem 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.
WtaSettingsKt.WtaSettingRow (cyclomatic 16) app/src/main/java/com/webtoapp/ui/design/WtaSettings.kt:316— WtaSettingsKt.WtaSettingRow 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.
AppModifierScreenKt.AppModifierScreen (cyclomatic 16) app/src/main/java/com/webtoapp/ui/screens/AppModifierScreen.kt:116— AppModifierScreenKt.AppModifierScreen 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.
CreateAppWebViewCardsKt.LongPressMenuStylePreview (cyclomatic 16) app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:196— CreateAppWebViewCardsKt.LongPressMenuStylePreview 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.
CreateAppWebViewCardsKt.BrowserAdvancedConfigCard (cyclomatic 16) app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:928— CreateAppWebViewCardsKt.BrowserAdvancedConfigCard 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.
CreateGoAppScreenKt.GoBuildInAppCard (cyclomatic 16) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:911— CreateGoAppScreenKt.GoBuildInAppCard 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.
StatsScreenKt.UsageRankCard (cyclomatic 16) app/src/main/java/com/webtoapp/ui/screens/StatsScreen.kt:408— StatsScreenKt.UsageRankCard has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FindInPageBarKt.FindInPageBar (cyclomatic 16) app/src/main/java/com/webtoapp/ui/shell/FindInPageBar.kt:35— FindInPageBarKt.FindInPageBar 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.
generate_submissions._resolve_contributors (cyclomatic 16) .github/scripts/ci/generate_submissions.py:472— generate_submissions._resolve_contributors 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.
validate_modules.main (cyclomatic 16) .github/scripts/ci/validate_modules.py:552— validate_modules.main 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.
check_config_field_drift.main (cyclomatic 16) scripts/check_config_field_drift.py:103— check_config_field_drift.main 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.
generate_shell_strings.main (cyclomatic 16) scripts/generate_shell_strings.py:431— generate_shell_strings.main has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
plugin.html.bindRow (cyclomatic 16) app/src/main/assets/plugins/builtin-url-switcher/plugin.html:207— plugin.html.bindRow has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 3 function items inside it that branch (a function literal at line 208, a function literal at line 223, up). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
server.server (cyclomatic 16) app/src/main/assets/sample_projects/nodejs-express/server.js:38— server.server 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.
D12 · Dependency Hygiene· No go.sum committed (REDACTED) · ×1
No go.sum committed (REDACTED) — REDACTED requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene· No go.sum committed (app/src/main/assets/sample_projects/go-echo-en/go.mod) · ×1
No go.sum committed (app/src/main/assets/sample_projects/go-echo-en/go.mod) — app/src/main/assets/sample_projects/go-echo-en/go.mod requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene· No go.sum committed (app/src/main/assets/sample_projects/go-echo/go.mod) · ×1
No go.sum committed (app/src/main/assets/sample_projects/go-echo/go.mod) — app/src/main/assets/sample_projects/go-echo/go.mod requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene· No go.sum committed (REDACTED) · ×1
No go.sum committed (REDACTED) — REDACTED requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene· No go.sum committed (app/src/main/assets/sample_projects/go-fiber-en/go.mod) · ×1
No go.sum committed (app/src/main/assets/sample_projects/go-fiber-en/go.mod) — app/src/main/assets/sample_projects/go-fiber-en/go.mod requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene· No go.sum committed (app/src/main/assets/sample_projects/go-fiber/go.mod) · ×1
No go.sum committed (app/src/main/assets/sample_projects/go-fiber/go.mod) — app/src/main/assets/sample_projects/go-fiber/go.mod requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene· No go.sum committed (app/src/main/assets/sample_projects/go-gin-ar/go.mod) · ×1
No go.sum committed (app/src/main/assets/sample_projects/go-gin-ar/go.mod) — app/src/main/assets/sample_projects/go-gin-ar/go.mod requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene· No go.sum committed (app/src/main/assets/sample_projects/go-gin-en/go.mod) · ×1
No go.sum committed (app/src/main/assets/sample_projects/go-gin-en/go.mod) — app/src/main/assets/sample_projects/go-gin-en/go.mod requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene· No go.sum committed (app/src/main/assets/sample_projects/go-gin/go.mod) · ×1
No go.sum committed (app/src/main/assets/sample_projects/go-gin/go.mod) — app/src/main/assets/sample_projects/go-gin/go.mod requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
WebViewActivityKt.WebViewScreen (cognitive 675) app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:1618— WebViewActivityKt.WebViewScreen has cognitive complexity 675 (threshold 15). Drivers by points: if/else 318 (509 pts), boolean chains 111, error handling 15 (24 pts), match/switch 13 (24 pts), loops 5 (7 pts) (nesting depth added 213). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebViewManager.createWebViewClient (cognitive 353) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:2267— WebViewManager.createWebViewClient has cognitive complexity 353 (threshold 15). Drivers by points: if/else 170 (268 pts), boolean chains 62, error handling 6 (11 pts), match/switch 5 (11 pts), loops 1 (nesting depth added 109). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateHtmlAppScreenKt.CreateHtmlAppScreen (cognitive 183) app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:94— CreateHtmlAppScreenKt.CreateHtmlAppScreen has cognitive complexity 183 (threshold 15). Drivers by points: if/else 91 (130 pts), boolean chains 32, error handling 7 (14 pts), match/switch 5 (7 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateNodeJsAppScreenKt.CreateNodeJsAppScreen (cognitive 161) app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:53— CreateNodeJsAppScreenKt.CreateNodeJsAppScreen has cognitive complexity 161 (threshold 15). Drivers by points: if/else 66 (120 pts), match/switch 8 (17 pts), boolean chains 15, error handling 5 (9 pts) (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.
ShellScreenKt.ShellScreen (cognitive 160) app/src/main/java/com/webtoapp/ui/shell/ShellScreen.kt:50— ShellScreenKt.ShellScreen has cognitive complexity 160 (threshold 15). Drivers by points: if/else 86 (110 pts), boolean chains 33, error handling 4 (10 pts), match/switch 4 (6 pts), loops 1 (nesting depth added 32). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HomeScreenKt.HomeScreen (cognitive 159) app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:118— HomeScreenKt.HomeScreen has cognitive complexity 159 (threshold 15). Drivers by points: if/else 78 (126 pts), boolean chains 13, error handling 4 (9 pts), match/switch 4 (9 pts), loops 1 (2 pts) (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.
ApkBuilder.buildApkInternal (cognitive 145) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:420— ApkBuilder.buildApkInternal has cognitive complexity 145 (threshold 15). Drivers by points: if/else 96 (113 pts), error handling 8 (13 pts), boolean chains 11, match/switch 4 (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.
WebViewManager.configureWebView (cognitive 128) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:1465— WebViewManager.configureWebView has cognitive complexity 128 (threshold 15). Drivers by points: if/else 79 (95 pts), boolean chains 20, match/switch 4 (7 pts), error handling 3 (6 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.
AgentEngine.run (cognitive 124) app/src/main/java/com/webtoapp/core/agent/engine/AgentEngine.kt:50— AgentEngine.run has cognitive complexity 124 (threshold 15). Drivers by points: if/else 34 (94 pts), loops 5 (13 pts), boolean chains 8, match/switch 2 (7 pts), error handling 2 (nesting depth added 73). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreatePythonAppScreenKt.CreatePythonAppScreen (cognitive 121) app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:49— CreatePythonAppScreenKt.CreatePythonAppScreen has cognitive complexity 121 (threshold 15). Drivers by points: if/else 51 (89 pts), error handling 8 (17 pts), boolean chains 11, match/switch 2 (3 pts), loops 1 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArscRebuilder.findIconPathIndices (cognitive 109) app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:301— ArscRebuilder.findIconPathIndices has cognitive complexity 109 (threshold 15). Drivers by points: if/else 24 (79 pts), boolean chains 14, loops 4 (11 pts), match/switch 1 (4 pts), error handling 1 (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildApkScreenKt.BuildApkContent (cognitive 104) app/src/main/java/com/webtoapp/ui/screens/BuildApkScreen.kt:136— BuildApkScreenKt.BuildApkContent has cognitive complexity 104 (threshold 15). Drivers by points: if/else 64 (80 pts), match/switch 9 (14 pts), boolean chains 8, error handling 2 (nesting depth added 21). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FileManagerScreenKt.FileManagerScreen (cognitive 104) app/src/main/java/com/webtoapp/ui/screens/FileManagerScreen.kt:146— FileManagerScreenKt.FileManagerScreen has cognitive complexity 104 (threshold 15). Drivers by points: if/else 62 (87 pts), boolean chains 17 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkBuilder.modifyApk (cognitive 103) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1441— ApkBuilder.modifyApk has cognitive complexity 103 (threshold 15). Drivers by points: if/else 51 (62 pts), boolean chains 29, match/switch 7 (10 pts), error handling 1 (2 pts) (nesting depth added 15). 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.
MultiWebShellModeKt.TabsMode (cognitive 103) app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt:245— MultiWebShellModeKt.TabsMode has cognitive complexity 103 (threshold 15). Drivers by points: if/else 66 (90 pts), boolean chains 10, match/switch 1 (2 pts), error handling 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AiApiClient.chatStream (cognitive 89) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1104— AiApiClient.chatStream has cognitive complexity 89 (threshold 15). Drivers by points: if/else 35 (66 pts), match/switch 7 (10 pts), error handling 4 (8 pts), boolean chains 4, loops 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AiApiClient.chatStreamWithTools (cognitive 80) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1840— AiApiClient.chatStreamWithTools has cognitive complexity 80 (threshold 15). Drivers by points: if/else 33 (51 pts), error handling 5 (16 pts), boolean chains 6, match/switch 4 (6 pts), loops 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.
CreateGoAppScreenKt.CreateGoAppScreen (cognitive 74) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:48— CreateGoAppScreenKt.CreateGoAppScreen has cognitive complexity 74 (threshold 15). Drivers by points: if/else 30 (60 pts), boolean chains 5, error handling 3 (5 pts), loops 2 (4 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreatePhpAppScreenKt.CreatePhpAppScreen (cognitive 73) app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:61— CreatePhpAppScreenKt.CreatePhpAppScreen has cognitive complexity 73 (threshold 15). Drivers by points: if/else 34 (50 pts), boolean chains 12, error handling 5 (7 pts), match/switch 2 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BgmSelectorKt.BgmSelectorDialog (cognitive 71) app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:53— BgmSelectorKt.BgmSelectorDialog has cognitive complexity 71 (threshold 15). Drivers by points: if/else 48 (65 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowHelper.applyImmersiveFullscreen (cognitive 71) app/src/main/java/com/webtoapp/ui/shared/WindowHelper.kt:120— WindowHelper.applyImmersiveFullscreen has cognitive complexity 71 (threshold 15). Drivers by points: if/else 31 (48 pts), error handling 4 (12 pts), match/switch 2 (7 pts), boolean chains 4 (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.
ShellActivity.onCreate (cognitive 71) app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:489— ShellActivity.onCreate has cognitive complexity 71 (threshold 15). Drivers by points: if/else 42 (54 pts), error handling 9 (10 pts), boolean chains 7 (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.
generate_shell_strings.mask_code (cognitive 71) scripts/generate_shell_strings.py:41— generate_shell_strings.mask_code has cognitive complexity 71 (threshold 15). Drivers by points: if/else 19 (59 pts), ternaries 3 (9 pts), boolean chains 2, loops 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AiSettingsScreenKt.AddModelDialog (cognitive 70) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:1138— AiSettingsScreenKt.AddModelDialog has cognitive complexity 70 (threshold 15). Drivers by points: if/else 31 (57 pts), boolean chains 10, match/switch 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateMultiWebAppScreenKt.CreateMultiWebAppScreen (cognitive 70) app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt:64— CreateMultiWebAppScreenKt.CreateMultiWebAppScreen has cognitive complexity 70 (threshold 15). Drivers by points: if/else 48 (65 pts), boolean chains 5 (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.
CreateFrontendAppScreenKt.CreateFrontendAppScreen (cognitive 68) app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:55— CreateFrontendAppScreenKt.CreateFrontendAppScreen has cognitive complexity 68 (threshold 15). Drivers by points: if/else 39 (55 pts), boolean chains 7, error handling 3, match/switch 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OnlineMusicSearchDialogKt.OnlineMusicSearchDialog (cognitive 67) app/src/main/java/com/webtoapp/ui/components/OnlineMusicSearchDialog.kt:72— OnlineMusicSearchDialogKt.OnlineMusicSearchDialog has cognitive complexity 67 (threshold 15). Drivers by points: if/else 41 (48 pts), boolean chains 13, error handling 3, match/switch 1 (2 pts), loops 1 (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.
ShellMediaContentKt.ShellSplashOverlay (cognitive 66) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:24— ShellMediaContentKt.ShellSplashOverlay has cognitive complexity 66 (threshold 15). Drivers by points: if/else 31 (47 pts), error handling 7 (13 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateWordPressAppScreenKt.CreateWordPressAppScreen (cognitive 64) app/src/main/java/com/webtoapp/ui/screens/CreateWordPressAppScreen.kt:57— CreateWordPressAppScreenKt.CreateWordPressAppScreen has cognitive complexity 64 (threshold 15). Drivers by points: if/else 32 (50 pts), error handling 4 (7 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GrepTool.execute (cognitive 63) app/src/main/java/com/webtoapp/core/agent/tool/builtin/GrepTool.kt:34— GrepTool.execute has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (47 pts), loops 4 (11 pts), boolean chains 3, error handling 1, match/switch 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StaticAssetScraper.scrape (cognitive 63) app/src/main/java/com/webtoapp/core/scraper/StaticAssetScraper.kt:130— StaticAssetScraper.scrape has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (33 pts), loops 9 (14 pts), error handling 6, match/switch 2 (6 pts), boolean chains 4 (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.
NodeDependencyManager.patchElfPageSize (cognitive 61) app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:657— NodeDependencyManager.patchElfPageSize has cognitive complexity 61 (threshold 15). Drivers by points: if/else 24 (39 pts), loops 11 (14 pts), boolean chains 8 (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.
ApkToAabAssembler.assemble (cognitive 60) app/src/main/java/com/webtoapp/core/playstore/aab/ApkToAabAssembler.kt:35— ApkToAabAssembler.assemble has cognitive complexity 60 (threshold 15). Drivers by points: if/else 24 (47 pts), boolean chains 5, error handling 1 (3 pts), loops 3, match/switch 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShellGalleryKt.ShellGalleryPlayer (cognitive 59) app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:50— ShellGalleryKt.ShellGalleryPlayer has cognitive complexity 59 (threshold 15). Drivers by points: if/else 31 (47 pts), boolean chains 8, match/switch 2 (3 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.
WtaCodeEditorDialogKt.WtaCodeEditorDialog (cognitive 57) app/src/main/java/com/webtoapp/ui/components/WtaCodeEditorDialog.kt:71— WtaCodeEditorDialogKt.WtaCodeEditorDialog has cognitive complexity 57 (threshold 15). Drivers by points: if/else 46 (52 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.
generate_submissions._resolve_for_path (cognitive 56) .github/scripts/ci/generate_submissions.py:303— generate_submissions._resolve_for_path has cognitive complexity 56 (threshold 15). Drivers by points: boolean chains 26, if/else 17 (24 pts), error handling 2, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DependencyDownloadEngine.downloadFileEx (cognitive 55) app/src/main/java/com/webtoapp/core/download/DependencyDownloadEngine.kt:201— DependencyDownloadEngine.downloadFileEx has cognitive complexity 55 (threshold 15). Drivers by points: if/else 26 (43 pts), boolean chains 5, loops 3 (4 pts), error handling 3 (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.
ShellMediaContentKt.MediaContentDisplay (cognitive 54) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:301— ShellMediaContentKt.MediaContentDisplay has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (43 pts), error handling 5 (10 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateMediaAppScreenKt.CreateMediaAppScreen (cognitive 52) app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:46— CreateMediaAppScreenKt.CreateMediaAppScreen has cognitive complexity 52 (threshold 15). Drivers by points: if/else 38 (46 pts), boolean chains 5, error handling 1 (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.
AutoStartCardKt.AutoStartCard (cognitive 51) app/src/main/java/com/webtoapp/ui/components/AutoStartCard.kt:36— AutoStartCardKt.AutoStartCard has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (22 pts), error handling 7 (21 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebViewActivity.onCreate (cognitive 51) app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:933— WebViewActivity.onCreate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 30 (43 pts), error handling 3 (5 pts), boolean chains 2, 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.
ProjectFileManager.scanLines (cognitive 49) app/src/main/java/com/webtoapp/core/agent/files/ProjectFileManager.kt:126— ProjectFileManager.scanLines has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (42 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ChromeExtensionParser.parseFromDirectory (cognitive 48) app/src/main/java/com/webtoapp/core/extension/ChromeExtensionParser.kt:56— ChromeExtensionParser.parseFromDirectory has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (29 pts), loops 5 (9 pts), boolean chains 7, match/switch 1 (2 pts), error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
php_router_server.executePHP (cognitive 48) app/src/main/assets/php_router_server.php:421— php_router_server.executePHP has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 9, loops 5 (8 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TlsMitmBridge.handleConnectCronet (cognitive 47) app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:369— TlsMitmBridge.handleConnectCronet has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (28 pts), error handling 6 (8 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginManagerScreenKt.PluginManagerScreen (cognitive 47) app/src/main/java/com/webtoapp/ui/screens/PluginManagerScreen.kt:53— PluginManagerScreenKt.PluginManagerScreen has cognitive complexity 47 (threshold 15). Drivers by points: if/else 27 (33 pts), match/switch 6 (11 pts), boolean chains 3 (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.
StringsA.screenAwakeTimeoutValue (cognitive 46) app/src/main/java/com/webtoapp/core/i18n/StringsA.kt:7115— StringsA.screenAwakeTimeoutValue has cognitive complexity 46 (threshold 15). Drivers by points: if/else 21 (41 pts), match/switch 3 (5 pts) (nesting depth added 22). 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.
PythonRuntime.waitForServerReady (cognitive 46) app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:796— PythonRuntime.waitForServerReady has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (28 pts), error handling 4 (13 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageBubblesKt.SpecialToolBody (cognitive 46) app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:938— MessageBubblesKt.SpecialToolBody has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (36 pts), boolean chains 9, 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.
AppCloner.modifyApk (cognitive 45) app/src/main/java/com/webtoapp/core/appmodifier/AppCloner.kt:392— AppCloner.modifyApk has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (30 pts), boolean chains 7, error handling 3 (7 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeckoViewEngine.setupPromptDelegate (cognitive 45) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1013— GeckoViewEngine.setupPromptDelegate has cognitive complexity 45 (threshold 15). Drivers by points: if/else 25, boolean chains 10, error handling 9, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WebViewManager.injectScripts (cognitive 45) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:4899— WebViewManager.injectScripts has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 9, 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.
GalleryPlayerScreenKt.GalleryPlayerScreen (cognitive 45) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:51— GalleryPlayerScreenKt.GalleryPlayerScreen has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (34 pts), boolean chains 7, match/switch 2 (3 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShellGalleryKt.ShellGalleryVideoPlayer (cognitive 45) app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:542— ShellGalleryKt.ShellGalleryVideoPlayer has cognitive complexity 45 (threshold 15). Drivers by points: if/else 25 (34 pts), error handling 5 (7 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShellWebViewConfigKt.buildWebViewConfig (cognitive 45) app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.kt:8— ShellWebViewConfigKt.buildWebViewConfig has cognitive complexity 45 (threshold 15). Drivers by points: error handling 34, if/else 4 (6 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonRuntime.startServer (cognitive 44) app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:75— PythonRuntime.startServer has cognitive complexity 44 (threshold 15). Drivers by points: if/else 30 (36 pts), error handling 4 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NativeBridge.httpRequest (cognitive 44) app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:1447— NativeBridge.httpRequest has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 9, error handling 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateGalleryAppScreenKt.CreateGalleryAppScreenV2 (cognitive 44) app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:1497— CreateGalleryAppScreenKt.CreateGalleryAppScreenV2 has cognitive complexity 44 (threshold 15). Drivers by points: if/else 33 (44 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.
CreateOfflinePackScreenKt.CreateOfflinePackScreen (cognitive 44) app/src/main/java/com/webtoapp/ui/screens/CreateOfflinePackScreen.kt:29— CreateOfflinePackScreenKt.CreateOfflinePackScreen has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 7, match/switch 2 (4 pts), error handling 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManualLrcAlignerKt.ManualLrcAlignerDialog (cognitive 42) app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:45— ManualLrcAlignerKt.ManualLrcAlignerDialog has cognitive complexity 42 (threshold 15). Drivers by points: if/else 26 (32 pts), match/switch 4 (5 pts), loops 2 (3 pts), boolean chains 1, error handling 1 (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.
SplashLauncherActivityKt.SplashLauncherScreen (cognitive 42) app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:110— SplashLauncherActivityKt.SplashLauncherScreen has cognitive complexity 42 (threshold 15). Drivers by points: if/else 26 (34 pts), boolean chains 8 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
generate_submissions.main (cognitive 42) .github/scripts/ci/generate_submissions.py:527— generate_submissions.main has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (23 pts), ternaries 4 (8 pts), boolean chains 5, error handling 2 (4 pts), loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChromeExtensionRuntimeKt.performNativeFetch (cognitive 41) app/src/main/java/com/webtoapp/core/extension/ChromeExtensionRuntime.kt:921— ChromeExtensionRuntimeKt.performNativeFetch has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 6, error handling 3 (6 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonRuntime.detectFramework (cognitive 41) app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:372— PythonRuntime.detectFramework has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (30 pts), error handling 3 (7 pts), boolean chains 3, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebsiteScraper.discoverResources (cognitive 41) REDACTED:383— WebsiteScraper.discoverResources has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 13, loops 5 (9 pts), error handling 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateAppApkSectionKt.CustomSigningSection (cognitive 41) app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.kt:721— CreateAppApkSectionKt.CustomSigningSection has cognitive complexity 41 (threshold 15). Drivers by points: if/else 25 (34 pts), error handling 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PortManagerScreenKt.PortManagerScreen (cognitive 41) app/src/main/java/com/webtoapp/ui/screens/PortManagerScreen.kt:108— PortManagerScreenKt.PortManagerScreen has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (25 pts), boolean chains 10, loops 2 (3 pts), error handling 2, match/switch 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.
RuntimeDepsScreenKt.RuntimeDepsScreen (cognitive 41) app/src/main/java/com/webtoapp/ui/screens/RuntimeDepsScreen.kt:138— RuntimeDepsScreenKt.RuntimeDepsScreen has cognitive complexity 41 (threshold 15). Drivers by points: if/else 26, match/switch 8, boolean chains 5, error handling 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.
ApkBuilder.addPythonAppFilesToAssets (cognitive 40) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:2879— ApkBuilder.addPythonAppFilesToAssets has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 9, error handling 5 (9 pts), match/switch 2 (4 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.
MarkdownTextKt.inlineAnnotated (cognitive 40) app/src/main/java/com/webtoapp/ui/agent/components/MarkdownText.kt:329— MarkdownTextKt.inlineAnnotated has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 8, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ElfInterpPatcher.rewriteInterp (cognitive 39) app/src/main/java/com/webtoapp/core/python/ElfInterpPatcher.kt:134— ElfInterpPatcher.rewriteInterp has cognitive complexity 39 (threshold 15). Drivers by points: if/else 26 (35 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkUpdateInstaller.streamToFile (cognitive 39) app/src/main/java/com/webtoapp/core/update/ApkUpdateInstaller.kt:165— ApkUpdateInstaller.streamToFile has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 5, loops 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.
ShellBgmPlayerKt.rememberBgmPlayerState (cognitive 39) app/src/main/java/com/webtoapp/ui/shell/ShellBgmPlayer.kt:321— ShellBgmPlayerKt.rememberBgmPlayerState has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (22 pts), error handling 5 (13 pts), boolean chains 2, loops 2 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ShellBrowserViewKt.ShellBrowserAndroidView (cognitive 39) app/src/main/java/com/webtoapp/ui/shell/ShellBrowserView.kt:22— ShellBrowserViewKt.ShellBrowserAndroidView has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23 (34 pts), boolean chains 4, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArscRebuilder.findLauncherBackgroundEntry (cognitive 38) app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:180— ArscRebuilder.findLauncherBackgroundEntry has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 2 (5 pts), boolean chains 4 (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.
LocalHttpServer.start (cognitive 38) app/src/main/java/com/webtoapp/core/webview/LocalHttpServer.kt:107— LocalHttpServer.start has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (23 pts), error handling 5 (11 pts), match/switch 2, 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.
WebViewManager.handleSpecialUrl (cognitive 38) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:4233— WebViewManager.handleSpecialUrl has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (26 pts), error handling 4 (7 pts), boolean chains 4, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuntimePermissionSyncKt.enableFrom (cognitive 38) app/src/main/java/com/webtoapp/data/model/RuntimePermissionSync.kt:3— RuntimePermissionSyncKt.enableFrom has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 37, if/else 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.
ModuleMarketScreenKt.ModuleMarketScreen (cognitive 38) app/src/main/java/com/webtoapp/ui/screens/ModuleMarketScreen.kt:103— ModuleMarketScreenKt.ModuleMarketScreen has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25 (31 pts), match/switch 3 (4 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.
GeckoEngineDownloader.download (cognitive 37) app/src/main/java/com/webtoapp/core/engine/download/GeckoEngineDownloader.kt:52— GeckoEngineDownloader.download has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (32 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ApkRuntimePermissions.manualBeyond (cognitive 37) app/src/main/java/com/webtoapp/data/model/WebApp.kt:1506— ApkRuntimePermissions.manualBeyond has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 37. 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.
GoRuntime.detectFramework (cognitive 36) app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:316— GoRuntime.detectFramework has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (30 pts), error handling 2 (5 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ElfInterpPatcher.currentInterp (cognitive 36) app/src/main/java/com/webtoapp/core/python/ElfInterpPatcher.kt:77— ElfInterpPatcher.currentInterp has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24 (31 pts), boolean chains 3, error handling 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.
BatchImportService.parseTextDetailed (cognitive 36) app/src/main/java/com/webtoapp/core/stats/BatchImportService.kt:47— BatchImportService.parseTextDetailed has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 6, match/switch 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GalleryPlayerScreenKt.GalleryVideoPlayer (cognitive 36) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:508— GalleryPlayerScreenKt.GalleryVideoPlayer has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (24 pts), error handling 6 (9 pts), boolean chains 2, 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.
CreateAppUserScriptsKt.UserScriptEditorDialog (cognitive 36) app/src/main/java/com/webtoapp/ui/screens/CreateAppUserScripts.kt:149— CreateAppUserScriptsKt.UserScriptEditorDialog has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23 (31 pts), match/switch 3, boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShellScaffoldLayoutKt.ShellScaffoldLayout (cognitive 36) app/src/main/java/com/webtoapp/ui/shell/ShellScaffoldLayout.kt:41— ShellScaffoldLayoutKt.ShellScaffoldLayout has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24 (26 pts), boolean chains 9, 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.
AxmlRebuilder.findActivityEndIndex (cognitive 35) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:894— AxmlRebuilder.findActivityEndIndex has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
JarSigner.importKeystore (cognitive 35) app/src/main/java/com/webtoapp/core/apkbuilder/JarSigner.kt:689— JarSigner.importKeystore has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 1, loops 1, 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.
DependencyDownloadEngine.downloadFileWithFallback (cognitive 35) app/src/main/java/com/webtoapp/core/download/DependencyDownloadEngine.kt:436— DependencyDownloadEngine.downloadFileWithFallback has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OnlineMusicSearchDialogKt.OnlineMusicTrackItem (cognitive 35) app/src/main/java/com/webtoapp/ui/components/OnlineMusicSearchDialog.kt:786— OnlineMusicSearchDialogKt.OnlineMusicTrackItem has cognitive complexity 35 (threshold 15). Drivers by points: if/else 24 (27 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CreateGoAppScreenKt.GoBuildInAppCard (cognitive 35) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:911— CreateGoAppScreenKt.GoBuildInAppCard has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebViewManager.applyNormalProxy (cognitive 34) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:2162— WebViewManager.applyNormalProxy has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (26 pts), error handling 2 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ZoomableStateKt.zoomableGesture (cognitive 34) app/src/main/java/com/webtoapp/ui/shared/ZoomableState.kt:140— ZoomableStateKt.zoomableGesture has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 4, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkExportPreflight.toBuildInputPreflightRequest (cognitive 33) app/src/main/java/com/webtoapp/core/apkbuilder/ApkExportPreflight.kt:67— ApkExportPreflight.toBuildInputPreflightRequest has cognitive complexity 33 (threshold 15). Drivers by points: if/else 30, match/switch 2, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HtmlProjectOptimizer.optimizeFiles (cognitive 33) app/src/main/java/com/webtoapp/core/linux/HtmlProjectOptimizer.kt:23— HtmlProjectOptimizer.optimizeFiles has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 2, error handling 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
PythonDependencyManager.extractTarGz (cognitive 33) REDACTED:1224— PythonDependencyManager.extractTarGz has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 3, error handling 1 (3 pts), loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExportPermissionCatalogKt.withExportGrant (cognitive 33) app/src/main/java/com/webtoapp/data/model/ExportPermissionCatalog.kt:513— ExportPermissionCatalogKt.withExportGrant has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 7 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageBubblesKt.ToolCallCard (cognitive 33) app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:702— MessageBubblesKt.ToolCallCard has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 3, match/switch 3, loops 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.
AxmlRebuilder.rewriteSaepPolicyMetadata (cognitive 32) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1661— AxmlRebuilder.rewriteSaepPolicyMetadata has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 9 (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.
HtmlProjectOptimizer.optimizeDirectory (cognitive 32) app/src/main/java/com/webtoapp/core/linux/HtmlProjectOptimizer.kt:94— HtmlProjectOptimizer.optimizeDirectory has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 3 (6 pts), boolean chains 2, error handling 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebViewManager.refetchWithHeaderModifications (cognitive 32) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3690— WebViewManager.refetchWithHeaderModifications has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (23 pts), error handling 5 (6 pts), match/switch 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AiSettingsScreenKt.AiSettingsScreen (cognitive 32) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:50— AiSettingsScreenKt.AiSettingsScreen has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (25 pts), loops 2 (4 pts), boolean chains 2, 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.
PlayStoreScreenKt.ExportAppCard (cognitive 32) app/src/main/java/com/webtoapp/ui/screens/PlayStoreScreen.kt:339— PlayStoreScreenKt.ExportAppCard has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkBuilder.addBgmToAssets (cognitive 31) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3155— ApkBuilder.addBgmToAssets has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 6, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StringsA.njsFrameworkTips (cognitive 31) app/src/main/java/com/webtoapp/core/i18n/StringsA.kt:3013— StringsA.njsFrameworkTips has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 11 (21 pts), if/else 10 (nesting depth added 10). 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.
StringsD.pyFrameworkTip (cognitive 31) app/src/main/java/com/webtoapp/core/i18n/StringsD.kt:7954— StringsD.pyFrameworkTip has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 11 (21 pts), if/else 10 (nesting depth added 10). 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.
StringsD.goFrameworkTip (cognitive 31) app/src/main/java/com/webtoapp/core/i18n/StringsD.kt:8307— StringsD.goFrameworkTip has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 11 (21 pts), if/else 10 (nesting depth added 10). 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.
WebViewManager.refreshSystemDarkMode (cognitive 31) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:284— WebViewManager.refreshSystemDarkMode has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (30 pts), error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentScreenKt.Conversation (cognitive 31) app/src/main/java/com/webtoapp/ui/agent/AgentScreen.kt:540— AgentScreenKt.Conversation has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WtaSwipeBackKt.WtaSwipeBackContainer (cognitive 31) app/src/main/java/com/webtoapp/ui/design/WtaSwipeBack.kt:33— WtaSwipeBackKt.WtaSwipeBackContainer has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AiSettingsScreenKt.AddApiKeyDialog (cognitive 31) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:821— AiSettingsScreenKt.AddApiKeyDialog has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24 (26 pts), boolean chains 4, 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.
CreateMultiWebAppScreenKt.ExistingAppPicker (cognitive 31) app/src/main/java/com/webtoapp/ui/screens/CreateMultiWebAppScreen.kt:599— CreateMultiWebAppScreenKt.ExistingAppPicker has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 3, match/switch 2 (3 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.
HostsAdBlockScreenKt.HostsAdBlockScreen (cognitive 31) app/src/main/java/com/webtoapp/ui/screens/HostsAdBlockScreen.kt:93— HostsAdBlockScreenKt.HostsAdBlockScreen has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 8, 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.
AppAccentPalettes.scheme (cognitive 31) app/src/main/java/com/webtoapp/ui/theme/AppAccent.kt:315— AppAccentPalettes.scheme has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (30 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WebViewActivity.launchFileChooserIntent (cognitive 31) app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:522— WebViewActivity.launchFileChooserIntent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (19 pts), error handling 4 (9 pts), boolean chains 2, 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.
WebViewSplashOverlayKt.SplashOverlay (cognitive 31) app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:30— WebViewSplashOverlayKt.SplashOverlay has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (22 pts), error handling 3 (5 pts), loops 1 (2 pts), boolean chains 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.
generate_shell_strings._find_member_end (cognitive 31) scripts/generate_shell_strings.py:214— generate_shell_strings._find_member_end has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (20 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdBlocker.parseProceduralSelector (cognitive 30) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:1759— AdBlocker.parseProceduralSelector has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 3 (4 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkBuilder.addHtmlFilesToAssets (cognitive 30) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3271— ApkBuilder.addHtmlFilesToAssets has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 9, error handling 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AxmlRebuilder.findRelativeClassNames (cognitive 30) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2057— AxmlRebuilder.findRelativeClassNames has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AxmlRebuilder.replacePackageBytes (cognitive 30) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2335— AxmlRebuilder.replacePackageBytes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ExtensionFileManager.downloadCrxFromStore (cognitive 30) app/src/main/java/com/webtoapp/core/extension/ExtensionFileManager.kt:161— ExtensionFileManager.downloadCrxFromStore has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FloatingWindowService.onStartCommand (cognitive 30) app/src/main/java/com/webtoapp/core/floatingwindow/FloatingWindowService.kt:85— FloatingWindowService.onStartCommand has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (21 pts), error handling 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AgentViewModel.handleAgentEvent (cognitive 30) app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt:1800— AgentViewModel.handleAgentEvent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BrowserDisguiseConfigCardKt.BrowserDisguiseConfigCard (cognitive 30) app/src/main/java/com/webtoapp/ui/components/BrowserDisguiseConfigCard.kt:34— BrowserDisguiseConfigCardKt.BrowserDisguiseConfigCard has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, match/switch 2, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ConfigTemplateMenuButtonKt.ConfigTemplateMenuButton (cognitive 30) app/src/main/java/com/webtoapp/ui/screens/ConfigTemplateMenuButton.kt:57— ConfigTemplateMenuButtonKt.ConfigTemplateMenuButton has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 2 (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.
CreateGalleryAppScreenKt.CreateGalleryAppScreen (cognitive 30) app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:55— CreateGalleryAppScreenKt.CreateGalleryAppScreen has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 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.
ShellPermissionDelegate.launchFileChooserIntent (cognitive 30) app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt:354— ShellPermissionDelegate.launchFileChooserIntent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (19 pts), error handling 4 (9 pts), boolean chains 1, 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.
SplashLauncherActivityKt.SplashContent (cognitive 30) app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:365— SplashLauncherActivityKt.SplashContent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (22 pts), error handling 3 (5 pts), loops 1 (2 pts), 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.
HtmlProjectHelper.processAndSaveFiles (cognitive 30) app/src/main/java/com/webtoapp/util/HtmlProjectHelper.kt:22— HtmlProjectHelper.processAndSaveFiles has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16, boolean chains 9, error handling 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.
content_script.pageWorldSetup (cognitive 30) app/src/main/assets/web_extensions/wta_native_bridge/content_script.js:91— content_script.pageWorldSetup has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 55, if/else 36 (45 pts), error handling 7 (9 pts), loops 3, ternaries 1 (nesting depth added 11). 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. This shape REPEATS in the file: one other method here (content_script.pageWorldSetup::bodyToBase64) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
AdBlocker.parseNetworkFilter (cognitive 29) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:1843— AdBlocker.parseNetworkFilter has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
AxmlRebuilder.modifyVersionInfo (cognitive 29) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1734— AxmlRebuilder.modifyVersionInfo has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 2 (3 pts), match/switch 1 (3 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.
BrowserDisguiseConfig.calculateCoverage (cognitive 29) app/src/main/java/com/webtoapp/core/appearance/DisguiseConfig.kt:253— BrowserDisguiseConfig.calculateCoverage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 29. 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.
MessageBubblesKt.MessageBubble (cognitive 29) app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:159— MessageBubblesKt.MessageBubble has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 3, match/switch 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.
IconPickerWithLibraryKt.IconPickerWithLibrary (cognitive 29) app/src/main/java/com/webtoapp/ui/components/IconPickerWithLibrary.kt:34— IconPickerWithLibraryKt.IconPickerWithLibrary has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 5, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
PlayStoreScreenKt.PlayStoreScreen (cognitive 29) app/src/main/java/com/webtoapp/ui/screens/PlayStoreScreen.kt:93— PlayStoreScreenKt.PlayStoreScreen has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 5, error handling 3, 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.
ShellServerModesKt.ServerAppShellMode (cognitive 29) app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:1182— ShellServerModesKt.ServerAppShellMode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20 (24 pts), error handling 2, boolean chains 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.
HtmlProjectProcessor.analyzeProject (cognitive 29) app/src/main/java/com/webtoapp/util/HtmlProjectProcessor.kt:102— HtmlProjectProcessor.analyzeProject has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_modules._validate_registry_entry (cognitive 29) .github/scripts/ci/validate_modules.py:184— validate_modules._validate_registry_entry has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 12, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ApkBuildCache.isContentReplaceableEntry (cognitive 28) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuildCache.kt:292— ApkBuildCache.isContentReplaceableEntry has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28. 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.
CloneManifestRewriter.findRelativeClassNames (cognitive 28) app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:518— CloneManifestRewriter.findRelativeClassNames has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectDetector.detectRuntimeRequirement (cognitive 28) app/src/main/java/com/webtoapp/core/frontend/ProjectDetector.kt:324— ProjectDetector.detectRuntimeRequirement has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 8, match/switch 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArscToProtoTable.convertType (cognitive 28) app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscToProtoTable.kt:48— ArscToProtoTable.convertType has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdBlocker.matchesAnyNetworkFilter (cognitive 27) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:1981— AdBlocker.matchesAnyNetworkFilter has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AxmlEditor.clearTestOnlyAttributes (cognitive 27) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlEditor.kt:242— AxmlEditor.clearTestOnlyAttributes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LegacyProxyFetchBridge.intercept (cognitive 27) app/src/main/java/com/webtoapp/core/webview/LegacyProxyFetchBridge.kt:216— LegacyProxyFetchBridge.intercept has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 6 (8 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LrcEditorDialogKt.LrcEditorDialog (cognitive 27) app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:39— LrcEditorDialogKt.LrcEditorDialog has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
LinuxEnvironmentScreenKt.ReadinessHero (cognitive 27) app/src/main/java/com/webtoapp/ui/screens/LinuxEnvironmentScreen.kt:392— LinuxEnvironmentScreenKt.ReadinessHero has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (16 pts), match/switch 6 (8 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.
ShellServerModesKt.HtmlFrontendShellMode (cognitive 27) app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:187— ShellServerModesKt.HtmlFrontendShellMode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4, match/switch 2 (3 pts), error handling 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.
ShellServerModesKt.PythonAppShellMode (cognitive 27) app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:847— ShellServerModesKt.PythonAppShellMode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (17 pts), error handling 3 (6 pts), match/switch 2 (3 pts), boolean chains 1 (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.
ShellWebViewCallbacksKt.createShellWebViewCallbacks (cognitive 27) app/src/main/java/com/webtoapp/ui/shell/ShellWebViewCallbacks.kt:31— ShellWebViewCallbacksKt.createShellWebViewCallbacks has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 6, match/switch 3, 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.
server.server (cognitive 27) app/src/main/assets/sample_projects/nodejs-koa/server.js:25— server.server has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 9, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JarSigner.trySignWithRetry (cognitive 26) app/src/main/java/com/webtoapp/core/apkbuilder/JarSigner.kt:1157— JarSigner.trySignWithRetry has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeckoViewEngine.setupPermissionDelegate (cognitive 26) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:2131— GeckoViewEngine.setupPermissionDelegate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (17 pts), error handling 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GitHubRepoFetcher.extract (cognitive 26) app/src/main/java/com/webtoapp/core/frontend/GitHubRepoFetcher.kt:158— GitHubRepoFetcher.extract has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoDirectBuilder.buildPackage (cognitive 26) app/src/main/java/com/webtoapp/core/golang/GoDirectBuilder.kt:384— GoDirectBuilder.buildPackage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoRuntime.startServer (cognitive 26) app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:93— GoRuntime.startServer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (21 pts), error handling 3, 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.
StatusBarImageCropperKt.StatusBarImageCropper (cognitive 26) app/src/main/java/com/webtoapp/ui/components/StatusBarImageCropper.kt:40— StatusBarImageCropperKt.StatusBarImageCropper has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 4, error handling 1, 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.
audit_ui_design_system.main (cognitive 26) .github/scripts/audit_ui_design_system.py:169— audit_ui_design_system.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 5 (8 pts), ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
content_script.pageWorldSetup (cognitive 26) app/src/main/assets/web_extensions/wta_share/content_script.js:31— content_script.pageWorldSetup has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 18, if/else 5, error handling 1, loops 1, ternaries 1. Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 36, shareFiles, a function literal at line 74, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AdBlocker.importHostsFromUrl (cognitive 25) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:2318— AdBlocker.importHostsFromUrl has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArscRebuilder.rebuildWithNewAppNameAndIcons (cognitive 25) app/src/main/java/com/webtoapp/core/apkbuilder/ArscRebuilder.kt:29— ArscRebuilder.rebuildWithNewAppNameAndIcons has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5 (7 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CloneManifestRewriter.findOriginalLauncherActivity (cognitive 25) app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:61— CloneManifestRewriter.findOriginalLauncherActivity has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
RuntimeProtection.detectFrida (cognitive 25) app/src/main/java/com/webtoapp/core/crypto/RuntimeProtection.kt:200— RuntimeProtection.detectFrida has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 6 (7 pts), boolean chains 4, loops 4 (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.
WebViewManager.injectCompatibilityScripts (cognitive 25) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:5156— WebViewManager.injectCompatibilityScripts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 6, 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.
ManualLrcAlignerKt.AlignmentStep (cognitive 25) app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:513— ManualLrcAlignerKt.AlignmentStep has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
InstallProjectDepsCardKt.InstallProjectDepsCard (cognitive 25) app/src/main/java/com/webtoapp/ui/screens/InstallProjectDepsCard.kt:43— InstallProjectDepsCardKt.InstallProjectDepsCard has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (17 pts), match/switch 6 (7 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ShellActivity.onNewIntent (cognitive 25) app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:1089— ShellActivity.onNewIntent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_modules._validate_registry (cognitive 25) .github/scripts/ci/validate_modules.py:236— validate_modules._validate_registry has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_modules._validate_plugin_json (cognitive 25) .github/scripts/ci/validate_modules.py:502— validate_modules._validate_plugin_json has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate_shell_strings.parse_members (cognitive 25) scripts/generate_shell_strings.py:282— generate_shell_strings.parse_members has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (8 pts), boolean chains 4, ternaries 1 (4 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.
ZipAligner.align (cognitive 24) app/src/main/java/com/webtoapp/core/apkbuilder/ZipAligner.kt:273— ZipAligner.align has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 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.
GeckoViewEngine.createView (cognitive 24) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:804— GeckoViewEngine.createView has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 3, match/switch 3, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
NetworkErrorDiagnostics.diagnose (cognitive 24) app/src/main/java/com/webtoapp/core/errorpage/NetworkErrorDiagnostics.kt:22— NetworkErrorDiagnostics.diagnose has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 10 (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.
LocalBuildEnvironment.detectToolVersion (cognitive 24) app/src/main/java/com/webtoapp/core/linux/LocalBuildEnvironment.kt:526— LocalBuildEnvironment.detectToolVersion has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
NodeService.handleStartServer (cognitive 24) app/src/main/java/com/webtoapp/core/nodejs/NodeService.kt:162— NodeService.handleStartServer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, error handling 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PluginImporter.unzipPackage (cognitive 24) app/src/main/java/com/webtoapp/core/plugin/PluginImporter.kt:264— PluginImporter.unzipPackage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, 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.
LocalHttpServer.handleClient (cognitive 24) app/src/main/java/com/webtoapp/core/webview/LocalHttpServer.kt:254— LocalHttpServer.handleClient has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BgmCardKt.BgmCard (cognitive 24) app/src/main/java/com/webtoapp/ui/components/BgmCard.kt:31— BgmCardKt.BgmCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20 (21 pts), match/switch 2, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VideoTrimmerKt.VideoTrimmer (cognitive 24) app/src/main/java/com/webtoapp/ui/components/VideoTrimmer.kt:30— VideoTrimmerKt.VideoTrimmer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), error handling 4 (6 pts), boolean chains 2, match/switch 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HomeScreenKt.AppCard (cognitive 24) app/src/main/java/com/webtoapp/ui/screens/HomeScreen.kt:1318— HomeScreenKt.AppCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (16 pts), match/switch 4 (7 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ShellActivity.onWindowFocusChanged (cognitive 24) app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:1051— ShellActivity.onWindowFocusChanged has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (22 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.
OllamaProvider.chatStream (cognitive 23) app/src/main/java/com/webtoapp/core/agent/llm/OllamaProvider.kt:22— OllamaProvider.chatStream has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, error handling 1 (2 pts), loops 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.
OpenAiCompatProvider.executeCall (cognitive 23) app/src/main/java/com/webtoapp/core/agent/llm/OpenAiCompatProvider.kt:48— OpenAiCompatProvider.executeCall has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), error handling 3 (4 pts), boolean chains 2, 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.
ExportRuntimeEnsure.ensure (cognitive 23) app/src/main/java/com/webtoapp/core/apkbuilder/ExportRuntimeEnsure.kt:34— ExportRuntimeEnsure.ensure has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalNetworkPermission.isPrivateNetworkHost (cognitive 23) app/src/main/java/com/webtoapp/core/webview/LocalNetworkPermission.kt:39— LocalNetworkPermission.isPrivateNetworkHost has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentViewModel.attachSession (cognitive 23) app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt:2228— AgentViewModel.attachSession has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BrowserDisguiseConfigCardKt.countActiveVectors (cognitive 23) app/src/main/java/com/webtoapp/ui/components/BrowserDisguiseConfigCard.kt:564— BrowserDisguiseConfigCardKt.countActiveVectors 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.
CreateAppScreenKt.BasicInfoCard (cognitive 23) app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:838— CreateAppScreenKt.BasicInfoCard has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileManagerScreenKt.FileEntryRow (cognitive 23) app/src/main/java/com/webtoapp/ui/screens/FileManagerScreen.kt:824— FileManagerScreenKt.FileEntryRow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (23 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.
ApkBuilder.addGalleryItemsToAssets (cognitive 22) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:2444— ApkBuilder.addGalleryItemsToAssets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5, 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.
ApkBuilder.requiresNetworkPermissions (cognitive 22) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3981— ApkBuilder.requiresNetworkPermissions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 9. 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.
AxmlRebuilder.modifyUsesSdkIntAttr (cognitive 22) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1827— AxmlRebuilder.modifyUsesSdkIntAttr has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AxmlRebuilder.stripTestOnlyFlag (cognitive 22) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1888— AxmlRebuilder.stripTestOnlyFlag has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserDisguiseEngine.countActiveVectors (cognitive 22) app/src/main/java/com/webtoapp/core/appearance/BrowserDisguiseEngine.kt:93— BrowserDisguiseEngine.countActiveVectors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22. 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.
CloneManifestRewriter.removeLauncherIntentFilters (cognitive 22) app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:107— CloneManifestRewriter.removeLauncherIntentFilters has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (8 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebRequestBridge.shouldBlock (cognitive 22) app/src/main/java/com/webtoapp/core/extension/WebRequestBridge.kt:67— WebRequestBridge.shouldBlock has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentScreenKt.AgentScreen (cognitive 22) app/src/main/java/com/webtoapp/ui/agent/AgentScreen.kt:123— AgentScreenKt.AgentScreen has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (18 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.
MessageBubblesKt.ThinkingBlock (cognitive 22) app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:321— MessageBubblesKt.ThinkingBlock has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatusBarBackgroundKt.StatusBarOverlay (cognitive 22) app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:125— StatusBarBackgroundKt.StatusBarOverlay has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 2 (4 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WtaSettingsKt.WtaSectionHeader (cognitive 22) app/src/main/java/com/webtoapp/ui/design/WtaSettings.kt:143— WtaSettingsKt.WtaSectionHeader has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20 (22 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CreateAppWebViewCardsKt.BrowserAdvancedConfigCard (cognitive 22) app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:928— CreateAppWebViewCardsKt.BrowserAdvancedConfigCard has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 4, 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.
MultiWebShellModeKt.DrawerMode (cognitive 22) app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt:1272— MultiWebShellModeKt.DrawerMode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (20 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.
MultiWebShellModeKt.fetchFeedItems (cognitive 22) app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt:1551— MultiWebShellModeKt.fetchFeedItems has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdBlocker.appendExportableRules (cognitive 21) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:1534— AdBlocker.appendExportableRules has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkAnalyzer.generateHints (cognitive 21) app/src/main/java/com/webtoapp/core/apkbuilder/ApkAnalyzer.kt:205— ApkAnalyzer.generateHints has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AxmlRebuilder.hasUsesPermission (cognitive 21) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:295— AxmlRebuilder.hasUsesPermission has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GreasemonkeyBridge.xmlHttpRequest (cognitive 21) app/src/main/java/com/webtoapp/core/extension/GreasemonkeyBridge.kt:280— GreasemonkeyBridge.xmlHttpRequest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, error handling 1, loops 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.
PhpAppRuntime.startServer (cognitive 21) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:69— PhpAppRuntime.startServer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, error handling 3, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CronetDependencyManager.extractCronetLib (cognitive 21) app/src/main/java/com/webtoapp/core/webview/CronetDependencyManager.kt:130— CronetDependencyManager.extractCronetLib has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebViewManager.createWebChromeClient (cognitive 21) app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt:3950— WebViewManager.createWebChromeClient has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2, error handling 1 (2 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.
MessageBubblesKt.RichAssistantTimeline (cognitive 21) app/src/main/java/com/webtoapp/ui/agent/components/MessageBubbles.kt:551— MessageBubblesKt.RichAssistantTimeline has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 8, 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.
EnhancedActivationDialogKt.EnhancedActivationStatusCard (cognitive 21) app/src/main/java/com/webtoapp/ui/components/EnhancedActivationDialog.kt:393— EnhancedActivationDialogKt.EnhancedActivationStatusCard has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), match/switch 2, 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.
IsolationConfigCardKt.ScreenPicker (cognitive 21) app/src/main/java/com/webtoapp/ui/components/IsolationConfigCard.kt:568— IsolationConfigCardKt.ScreenPicker has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 9 (10 pts), match/switch 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LanguageSelectorKt.FirstLaunchLanguageScreen (cognitive 21) app/src/main/java/com/webtoapp/ui/components/LanguageSelector.kt:213— LanguageSelectorKt.FirstLaunchLanguageScreen has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, match/switch 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatusBarBackgroundKt.StatusBarBackground (cognitive 21) app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:46— StatusBarBackgroundKt.StatusBarBackground has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), match/switch 2 (4 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WtaSettingsKt.WtaSettingRow (cognitive 21) app/src/main/java/com/webtoapp/ui/design/WtaSettings.kt:316— WtaSettingsKt.WtaSettingRow has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (16 pts), match/switch 2 (3 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.
AboutScreenKt.OtherProjectsSection (cognitive 21) app/src/main/java/com/webtoapp/ui/screens/AboutScreen.kt:1760— AboutScreenKt.OtherProjectsSection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, match/switch 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AiSettingsScreenKt.SavedModelItem (cognitive 21) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:592— AiSettingsScreenKt.SavedModelItem has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (17 pts), match/switch 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.
CreateAppWebViewCardsKt.SpecialSettingsCard (cognitive 21) app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:3414— CreateAppWebViewCardsKt.SpecialSettingsCard has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (18 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RuntimeDepsScreenKt.StatusOverviewCard (cognitive 21) app/src/main/java/com/webtoapp/ui/screens/RuntimeDepsScreen.kt:704— RuntimeDepsScreenKt.StatusOverviewCard has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (17 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FindInPageBarKt.FindInPageBar (cognitive 21) app/src/main/java/com/webtoapp/ui/shell/FindInPageBar.kt:35— FindInPageBarKt.FindInPageBar has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), error handling 5 (8 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MainViewModel.saveMultiWebApp (cognitive 21) app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:1131— MainViewModel.saveMultiWebApp has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, 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.
ZipProjectImporter.extractZip (cognitive 21) app/src/main/java/com/webtoapp/util/ZipProjectImporter.kt:118— ZipProjectImporter.extractZip has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), error handling 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate_shell_strings.main (cognitive 21) scripts/generate_shell_strings.py:431— generate_shell_strings.main has cognitive complexity 21 (threshold 15). Drivers by points: loops 9 (11 pts), if/else 6 (10 pts) (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CompactService.collectText (cognitive 20) app/src/main/java/com/webtoapp/core/agent/engine/CompactService.kt:215— CompactService.collectText has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, match/switch 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LoopbackHttpServer.readRequest (cognitive 20) app/src/main/java/com/webtoapp/core/agent/mcp/LoopbackHttpServer.kt:84— LoopbackHttpServer.readRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (5 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.
PreviewTool.execute (cognitive 20) app/src/main/java/com/webtoapp/core/agent/tool/builtin/PreviewTool.kt:56— PreviewTool.execute 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.
AiApiClient.fetchModels (cognitive 20) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:151— AiApiClient.fetchModels has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 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.
ApkBuilder.isComplexHtmlProject (cognitive 20) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3419— ApkBuilder.isComplexHtmlProject has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 7, error handling 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.
DataBackupManager.collectAppResources (cognitive 20) app/src/main/java/com/webtoapp/core/backup/DataBackupManager.kt:731— DataBackupManager.collectAppResources has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (16 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.
DataBackupManager.stageLocalBackupEntry (cognitive 20) app/src/main/java/com/webtoapp/core/backup/DataBackupManager.kt:1116— DataBackupManager.stageLocalBackupEntry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, error handling 2, 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.
DeclarativeNetRequestEngine.matchesRule (cognitive 20) app/src/main/java/com/webtoapp/core/extension/DeclarativeNetRequestEngine.kt:439— DeclarativeNetRequestEngine.matchesRule has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, 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.
FloatingWindowManager.createMiniButton (cognitive 20) app/src/main/java/com/webtoapp/core/floatingwindow/FloatingWindowManager.kt:895— FloatingWindowManager.createMiniButton has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GoBuildEnvironment.buildProjectOnce (cognitive 20) app/src/main/java/com/webtoapp/core/golang/GoBuildEnvironment.kt:289— GoBuildEnvironment.buildProjectOnce has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PhpAppRuntime.detectFramework (cognitive 20) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:301— PhpAppRuntime.detectFramework has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IsolationScriptInjector.generateIsolationScript (cognitive 20) app/src/main/java/com/webtoapp/core/privacy/IsolationScriptInjector.kt:5— IsolationScriptInjector.generateIsolationScript has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (18 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.
SampleProjectExtractor.supplementHiddenAssetsFromApk (cognitive 20) app/src/main/java/com/webtoapp/core/sample/SampleProjectExtractor.kt:129— SampleProjectExtractor.supplementHiddenAssetsFromApk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CertificateHostnameMatcher.matches (cognitive 20) app/src/main/java/com/webtoapp/core/webview/CertificateHostnameMatcher.kt:20— CertificateHostnameMatcher.matches has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HtmlPreviewActivityKt.HtmlPreviewScreen (cognitive 20) app/src/main/java/com/webtoapp/ui/codepreview/HtmlPreviewActivity.kt:83— HtmlPreviewActivityKt.HtmlPreviewScreen has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, error handling 3 (4 pts), match/switch 2, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BgmSelectorKt.LrcPreviewDialog (cognitive 20) app/src/main/java/com/webtoapp/ui/components/BgmSelector.kt:1314— BgmSelectorKt.LrcPreviewDialog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WtaReorderableUrlListKt.ReorderableColumn (cognitive 20) app/src/main/java/com/webtoapp/ui/components/WtaReorderableUrlList.kt:132— WtaReorderableUrlListKt.ReorderableColumn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (18 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.
AppModifierScreenKt.AppModifyContent (cognitive 20) app/src/main/java/com/webtoapp/ui/screens/AppModifierScreen.kt:568— AppModifierScreenKt.AppModifyContent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 6, error handling 2, 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.
CreateNodeJsAppScreenKt.NodeJsDependenciesCard (cognitive 20) app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:1375— CreateNodeJsAppScreenKt.NodeJsDependenciesCard 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.
CreatePhpAppScreenKt.PhpComposerDepsCard (cognitive 20) app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:716— CreatePhpAppScreenKt.PhpComposerDepsCard 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.
HostsAdBlockScreenKt.HostsSourceCard (cognitive 20) app/src/main/java/com/webtoapp/ui/screens/HostsAdBlockScreen.kt:658— HostsAdBlockScreenKt.HostsSourceCard has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, match/switch 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShellScaffoldLayoutKt.ShellTopAppBar (cognitive 20) app/src/main/java/com/webtoapp/ui/shell/ShellScaffoldLayout.kt:368— ShellScaffoldLayoutKt.ShellTopAppBar has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (19 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.
DownloadHelper.resolveDownloadTargetFile (cognitive 20) app/src/main/java/com/webtoapp/util/DownloadHelper.kt:630— DownloadHelper.resolveDownloadTargetFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 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.
NetEaseOfficialChannel.getTrackDetail (cognitive 19) app/src/main/java/com/webtoapp/core/bgm/OnlineMusicApi.kt:272— NetEaseOfficialChannel.getTrackDetail has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoToolchainManager.extractGoArchiveToRoot (cognitive 19) app/src/main/java/com/webtoapp/core/golang/GoToolchainManager.kt:415— GoToolchainManager.extractGoArchiveToRoot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (6 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArscReader.parsePackage (cognitive 19) app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscReader.kt:95— ArscReader.parsePackage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PortManager.purgeStaleAllocations (cognitive 19) app/src/main/java/com/webtoapp/core/port/PortManager.kt:300— PortManager.purgeStaleAllocations has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonDependencyManager.downloadPython (cognitive 19) REDACTED:1080— PythonDependencyManager.downloadPython has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, 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.
MainActivity.onCreate (cognitive 19) app/src/main/java/com/webtoapp/ui/MainActivity.kt:65— MainActivity.onCreate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), error handling 6 (8 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentViewModel.buildRequestParts (cognitive 19) app/src/main/java/com/webtoapp/ui/agent/AgentViewModel.kt:1452— AgentViewModel.buildRequestParts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, 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.
ManualLrcAlignerKt.AlignmentLineItem (cognitive 19) app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:743— ManualLrcAlignerKt.AlignmentLineItem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (15 pts), match/switch 3, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppModifierScreenKt.AppModifierScreen (cognitive 19) app/src/main/java/com/webtoapp/ui/screens/AppModifierScreen.kt:116— AppModifierScreenKt.AppModifierScreen has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, match/switch 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeviceDisguiseCardKt.DeviceDisguiseCard (cognitive 19) app/src/main/java/com/webtoapp/ui/screens/DeviceDisguiseCard.kt:29— DeviceDisguiseCardKt.DeviceDisguiseCard has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
PluginManagerScreenKt.pluginReorderable (cognitive 19) app/src/main/java/com/webtoapp/ui/screens/PluginManagerScreen.kt:453— PluginManagerScreenKt.pluginReorderable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ShellActivityInit.createBackPressedCallback (cognitive 19) app/src/main/java/com/webtoapp/ui/shell/ShellActivityInit.kt:182— ShellActivityInit.createBackPressedCallback has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ShellWebViewNavigation.resolveBackAction (cognitive 19) app/src/main/java/com/webtoapp/ui/shell/ShellWebViewNavigation.kt:198— ShellWebViewNavigation.resolveBackAction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DownloadNotificationManager.handleDownloadComplete (cognitive 19) app/src/main/java/com/webtoapp/util/DownloadNotificationManager.kt:217— DownloadNotificationManager.handleDownloadComplete has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_config_field_drift.main (cognitive 19) scripts/check_config_field_drift.py:103— check_config_field_drift.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 6 (9 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
content_script.pageWorldSetup::bodyToBase64 (cognitive 19) app/src/main/assets/web_extensions/wta_native_bridge/content_script.js:125— content_script.pageWorldSetup::bodyToBase64 has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, error handling 2 (4 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. This shape REPEATS in the file: one other method here (content_script.pageWorldSetup) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
AdBlocker.parseFilterContent (cognitive 18) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:2422— AdBlocker.parseFilterContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AiApiClient.inferContextLength (cognitive 18) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:434— AiApiClient.inferContextLength has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 16, if/else 1, match/switch 1. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ApkBuilder.addHtmlFilesPreserveStructure (cognitive 18) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3494— ApkBuilder.addHtmlFilesPreserveStructure has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, 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.
ApkBuilderKt.resolveMultiWebSiteMediaInputs (cognitive 18) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:4968— ApkBuilderKt.resolveMultiWebSiteMediaInputs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, error handling 2 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AxmlRebuilder.findActivityStartIndex (cognitive 18) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:852— AxmlRebuilder.findActivityStartIndex has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AxmlRebuilder.mergeManifestFragment (cognitive 18) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1342— AxmlRebuilder.mergeManifestFragment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, loops 2, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
DeviceDisguiseConfig.generateUserAgent (cognitive 18) app/src/main/java/com/webtoapp/core/appearance/DeviceDisguiseConfig.kt:43— DeviceDisguiseConfig.generateUserAgent has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 7 (nesting depth added 5). 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.
DataBackupManager.importAllData (cognitive 18) app/src/main/java/com/webtoapp/core/backup/DataBackupManager.kt:329— DataBackupManager.importAllData has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, error handling 3, match/switch 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FloatingWindowManager.setupDragHandler (cognitive 18) app/src/main/java/com/webtoapp/core/floatingwindow/FloatingWindowManager.kt:575— FloatingWindowManager.setupDragHandler has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LocalDnsBridgeProxy.readHttpLine (cognitive 18) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:475— LocalDnsBridgeProxy.readHttpLine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PerformanceOptimizerApk.optimizeBytesForApk (cognitive 18) app/src/main/java/com/webtoapp/core/linux/PerformanceOptimizerApk.kt:27— PerformanceOptimizerApk.optimizeBytesForApk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 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.
ArscReader.parseType (cognitive 18) app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscReader.kt:180— ArscReader.parseType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProtoManifestRewriter.extractTargetSdkVersion (cognitive 18) app/src/main/java/com/webtoapp/core/playstore/aab/axml/ProtoManifestRewriter.kt:123— ProtoManifestRewriter.extractTargetSdkVersion has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonRuntime.generatePreviewHtml (cognitive 18) app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:546— PythonRuntime.generatePreviewHtml has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, error handling 2 (4 pts), match/switch 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WebsiteScraper.scrape (cognitive 18) REDACTED:136— WebsiteScraper.scrape has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalHttpHostMappingBridge.readHttpLine (cognitive 18) app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:456— LocalHttpHostMappingBridge.readHttpLine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TlsMitmBridge.readHttpLine (cognitive 18) app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:749— TlsMitmBridge.readHttpLine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HtmlFileSlotKt.HtmlFileSlot (cognitive 18) app/src/main/java/com/webtoapp/ui/components/HtmlFileSlot.kt:24— HtmlFileSlotKt.HtmlFileSlot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16 (18 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IsolationConfigCardKt.IsolationConfigCard (cognitive 18) app/src/main/java/com/webtoapp/ui/components/IsolationConfigCard.kt:37— IsolationConfigCardKt.IsolationConfigCard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CreateAppWebViewCardsKt.AdBlockCard (cognitive 18) app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:430— CreateAppWebViewCardsKt.AdBlockCard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 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.
MultiWebShellModeKt.FeedMode (cognitive 18) app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt:1058— MultiWebShellModeKt.FeedMode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, loops 1, 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.
ShellStartupPermissions.buildSpecialQueue (cognitive 18) app/src/main/java/com/webtoapp/ui/shell/ShellStartupPermissions.kt:128— ShellStartupPermissions.buildSpecialQueue has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
validate_modules.main (cognitive 18) .github/scripts/ci/validate_modules.py:552— validate_modules.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 3, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate_shell_strings.collect_seeds (cognitive 18) scripts/generate_shell_strings.py:348— generate_shell_strings.collect_seeds has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 3 (6 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.
server.server (cognitive 18) app/src/main/assets/sample_projects/nodejs-express/server.js:38— server.server 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.
ActivationManager.validateActivationCode (cognitive 17) app/src/main/java/com/webtoapp/core/activation/ActivationManager.kt:217— ActivationManager.validateActivationCode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdBlocker.matchesNetworkFilter (cognitive 17) app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt:2038— AdBlocker.matchesNetworkFilter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
AnthropicProvider.chatStream (cognitive 17) app/src/main/java/com/webtoapp/core/agent/llm/AnthropicProvider.kt:25— AnthropicProvider.chatStream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (5 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TodoManager.updateFlexible (cognitive 17) app/src/main/java/com/webtoapp/core/agent/todo/TodoManager.kt:57— TodoManager.updateFlexible has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, loops 1 (2 pts), match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkBuilder.addSplashMediaToAssets (cognitive 17) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:2102— ApkBuilder.addSplashMediaToAssets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ApkBuilder.isEditorOnlyAsset (cognitive 17) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:3803— ApkBuilder.isEditorOnlyAsset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, 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.
ApkBuilderKt.resolveErrorPageMediaPath (cognitive 17) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:4559— ApkBuilderKt.resolveErrorPageMediaPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 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.
AxmlEditor.restoreComponentClassNames (cognitive 17) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlEditor.kt:125— AxmlEditor.restoreComponentClassNames has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ElfAligner16k.ensureAligned (cognitive 17) app/src/main/java/com/webtoapp/core/apkbuilder/ElfAligner16k.kt:30— ElfAligner16k.ensureAligned has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ErrorPageManager.generateBuiltInPage (cognitive 17) app/src/main/java/com/webtoapp/core/errorpage/ErrorPageManager.kt:120— ErrorPageManager.generateBuiltInPage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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.
GreasyForkSearch.fetchScriptCode (cognitive 17) app/src/main/java/com/webtoapp/core/market/GreasyForkSearch.kt:165— GreasyForkSearch.fetchScriptCode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeDependencyManager.readElfMinLoadAlign (cognitive 17) app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:536— NodeDependencyManager.readElfMinLoadAlign has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, 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.
SharedContentInbox.acceptIntent (cognitive 17) app/src/main/java/com/webtoapp/core/share/SharedContentInbox.kt:59— SharedContentInbox.acceptIntent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 1 (2 pts), 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.
LegacyProxyFetchBridge.isBypassed (cognitive 17) app/src/main/java/com/webtoapp/core/webview/LegacyProxyFetchBridge.kt:190— LegacyProxyFetchBridge.isBypassed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalHttpToSocksBridge.readHttpLine (cognitive 17) app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:294— LocalHttpToSocksBridge.readHttpLine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WordPressPhpRuntime.startServer (cognitive 17) app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:59— WordPressPhpRuntime.startServer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, error handling 3, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RuntimePermissionSyncKt.featurePermissionReasons (cognitive 17) app/src/main/java/com/webtoapp/data/model/RuntimePermissionSync.kt:188— RuntimePermissionSyncKt.featurePermissionReasons has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MarkdownTextKt.parseMarkdownBlocks (cognitive 17) app/src/main/java/com/webtoapp/ui/agent/components/MarkdownText.kt:248— MarkdownTextKt.parseMarkdownBlocks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActivationCodeCardKt.AddActivationCodeDialog (cognitive 17) app/src/main/java/com/webtoapp/ui/components/ActivationCodeCard.kt:1078— ActivationCodeCardKt.AddActivationCodeDialog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, match/switch 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LiquidTabBarKt.LiquidTabBar (cognitive 17) app/src/main/java/com/webtoapp/ui/components/LiquidTabBar.kt:60— LiquidTabBarKt.LiquidTabBar has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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.
CreateAppAnnouncementCardKt.AnnouncementCard (cognitive 17) app/src/main/java/com/webtoapp/ui/screens/CreateAppAnnouncementCard.kt:51— CreateAppAnnouncementCardKt.AnnouncementCard has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, error handling 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CreateAppScreenKt.CreateAppScreen (cognitive 17) app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:72— CreateAppScreenKt.CreateAppScreen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CreateAppWebViewCardsKt.LongPressMenuStylePreview (cognitive 17) app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:196— CreateAppWebViewCardsKt.LongPressMenuStylePreview has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PermissionConfigScreenKt.PermissionConfigPanel (cognitive 17) app/src/main/java/com/webtoapp/ui/screens/PermissionConfigScreen.kt:264— PermissionConfigScreenKt.PermissionConfigPanel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PermissionConfigScreenKt.PermissionGroupCard (cognitive 17) app/src/main/java/com/webtoapp/ui/screens/PermissionConfigScreen.kt:572— PermissionConfigScreenKt.PermissionGroupCard has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 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.
GoProjectSourceLoader.copyDocumentTreeToProject (cognitive 17) app/src/main/java/com/webtoapp/ui/screens/create/runtime/GoProjectSourceLoader.kt:12— GoProjectSourceLoader.copyDocumentTreeToProject has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainViewModel.updateMultiWebApp (cognitive 17) app/src/main/java/com/webtoapp/ui/viewmodel/MainViewModel.kt:1187— MainViewModel.updateMultiWebApp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 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.
generate_submissions._resolve_contributors (cognitive 17) .github/scripts/ci/generate_submissions.py:472— generate_submissions._resolve_contributors has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (6 pts), loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CloneLauncherActivity.showSplash (cognitive 16) clone-host/src/main/java/com/webtoapp/clone/CloneLauncherActivity.kt:314— CloneLauncherActivity.showSplash has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
AnthropicProvider.buildMsg (cognitive 16) app/src/main/java/com/webtoapp/core/agent/llm/AnthropicProvider.kt:67— AnthropicProvider.buildMsg has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GenerateImageTool.execute (cognitive 16) app/src/main/java/com/webtoapp/core/agent/tool/builtin/imagery/GenerateImageTool.kt:44— GenerateImageTool.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, match/switch 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkArtifactVerifier.requireMultiWebAssets (cognitive 16) app/src/main/java/com/webtoapp/core/apkbuilder/ApkArtifactVerifier.kt:363— ApkArtifactVerifier.requireMultiWebAssets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkBuilder.addErrorPageMediaToAssets (cognitive 16) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:2193— ApkBuilder.addErrorPageMediaToAssets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
MultiWebContentEmbedder.embed (cognitive 16) app/src/main/java/com/webtoapp/core/apkbuilder/AppContentEmbedder.kt:233— MultiWebContentEmbedder.embed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AxmlRebuilder.pruneUsesPermissions (cognitive 16) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:182— AxmlRebuilder.pruneUsesPermissions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AxmlRebuilder.buildFragmentElement (cognitive 16) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1437— AxmlRebuilder.buildFragmentElement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CloneManifestRewriter.intentFilterContainsMainAndLauncher (cognitive 16) app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:150— CloneManifestRewriter.intentFilterContainsMainAndLauncher has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EngineViewFactory.prepareGeckoNetwork (cognitive 16) app/src/main/java/com/webtoapp/core/engine/EngineViewFactory.kt:116— EngineViewFactory.prepareGeckoNetwork has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GoDirectBuilder.build (cognitive 16) app/src/main/java/com/webtoapp/core/golang/GoDirectBuilder.kt:77— GoDirectBuilder.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeRuntime.generatePreviewHtml (cognitive 16) app/src/main/java/com/webtoapp/core/nodejs/NodeRuntime.kt:183— NodeRuntime.generatePreviewHtml has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, error handling 2 (4 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NodeRuntime.createProjectFromUri (cognitive 16) app/src/main/java/com/webtoapp/core/nodejs/NodeRuntime.kt:280— NodeRuntime.createProjectFromUri has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationWebSocketService.onStartCommand (cognitive 16) app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:317— NotificationWebSocketService.onStartCommand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 3 (4 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.
ArscToProtoTable.convertBag (cognitive 16) app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscToProtoTable.kt:340— ArscToProtoTable.convertBag has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 3 (4 pts), match/switch 2 (4 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PythonRuntime.createProjectFromUri (cognitive 16) app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:500— PythonRuntime.createProjectFromUri has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, 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.
ShellModeManager.computeShellConfig (cognitive 16) app/src/main/java/com/webtoapp/core/shell/ShellModeManager.kt:53— ShellModeManager.computeShellConfig has cognitive complexity 16 (threshold 15). Drivers by points: error handling 5 (7 pts), boolean chains 4, if/else 4, match/switch 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalHttpToSocksBridge.acceptLoop (cognitive 16) app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:105— LocalHttpToSocksBridge.acceptLoop has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (10 pts), if/else 2 (5 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeBridge.isPrivateNetworkHost (cognitive 16) app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:538— NativeBridge.isPrivateNetworkHost has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, 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.
TlsMitmBridge.acceptLoop (cognitive 16) app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:178— TlsMitmBridge.acceptLoop has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (10 pts), if/else 2 (5 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuntimePermissionSyncKt.featureRequiredRuntimePermissions (cognitive 16) app/src/main/java/com/webtoapp/data/model/RuntimePermissionSync.kt:46— RuntimePermissionSyncKt.featureRequiredRuntimePermissions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IconGeneratorDialogKt.IconGeneratorDialog (cognitive 16) app/src/main/java/com/webtoapp/ui/components/IconGeneratorDialog.kt:42— IconGeneratorDialogKt.IconGeneratorDialog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ManualLrcAlignerKt.PreviewStep (cognitive 16) app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:848— ManualLrcAlignerKt.PreviewStep has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MediaAppActivityKt.VideoPlayer (cognitive 16) app/src/main/java/com/webtoapp/ui/media/MediaAppActivity.kt:254— MediaAppActivityKt.VideoPlayer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
CreateAppUserScriptsKt.UserScriptsSection (cognitive 16) app/src/main/java/com/webtoapp/ui/screens/CreateAppUserScripts.kt:40— CreateAppUserScriptsKt.UserScriptsSection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 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.
CreateGoAppScreenKt.GoBinaryDetectionCard (cognitive 16) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:610— CreateGoAppScreenKt.GoBinaryDetectionCard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, match/switch 5, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PortManagerScreenKt.ThisAppTabContent (cognitive 16) app/src/main/java/com/webtoapp/ui/screens/PortManagerScreen.kt:443— PortManagerScreenKt.ThisAppTabContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiWebShellModeKt.TopTabStrip (cognitive 16) app/src/main/java/com/webtoapp/ui/shell/MultiWebShellMode.kt:687— MultiWebShellModeKt.TopTabStrip has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (16 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.
BgmStorage.extensionFromMagic (cognitive 16) app/src/main/java/com/webtoapp/util/BgmStorage.kt:273— BgmStorage.extensionFromMagic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
NetworkTrustStorage.normalizeEncoding (cognitive 16) app/src/main/java/com/webtoapp/util/NetworkTrustStorage.kt:140— NetworkTrustStorage.normalizeEncoding has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_modules._validate_folder_layout (cognitive 16) .github/scripts/ci/validate_modules.py:308— validate_modules._validate_folder_layout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, 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.
php_router_server.parseMultipart (cognitive 16) app/src/main/assets/php_router_server.php:596— php_router_server.parseMultipart 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.
D4 · Code Duplication· Near-duplicate member family (3 members, 73 shared lines) · ×1
Near-duplicate member family (3 members, 73 shared lines) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:35— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:35-298 | app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:376-544 | app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:35-218 — These 3 members are variants of one another: a block of 73 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (69 shared lines) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:518— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:518-732 | app/src/main/java/com/webtoapp/ui/shell/ShellGallery.kt:553-846 — 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 (52 shared lines) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:78— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:78-229 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:59-181 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (49 shared lines) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:388— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:388-464 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:246-314 — These two members are variants of one another: 49 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (48 shared lines) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:433— app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:433-544 | app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:599-782 — These two members are variants of one another: 48 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) app/src/main/java/com/webtoapp/core/agent/tool/builtin/GlobTool.kt:47— app/src/main/java/com/webtoapp/core/agent/tool/builtin/GlobTool.kt:47-69 | app/src/main/java/com/webtoapp/core/agent/tool/builtin/GrepTool.kt:111-132 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1017— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1017-1056 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1068-1099 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1110-1143 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1152-1174 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1181-1212 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:243-283 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:285-307 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:314-345 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· 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/webtoapp/ui/components/BackgroundRunConfigCard.kt:40— app/src/main/java/com/webtoapp/ui/components/BackgroundRunConfigCard.kt:40-183 | app/src/main/java/com/webtoapp/ui/components/BgmCard.kt:36-322 | app/src/main/java/com/webtoapp/ui/components/EncryptionConfigCard.kt:30-187 | app/src/main/java/com/webtoapp/ui/components/IsolationConfigCard.kt:41-334 | app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:48-197 | app/src/main/java/com/webtoapp/ui/components/PluginPickerCard.kt:46-175 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:435-657 — 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.
Duplicated block (65 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1666— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1666-1730 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2109-2173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1666` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (58 lines × 2) app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:341— app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:341-398 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:624-681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:341` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (57 lines × 2) app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt:137— app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt:137-193 | shell/src/main/java-overrides/com/webtoapp/core/autostart/BootReceiver.kt:103-159 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/autostart/BootReceiver.kt` and `shell/src/main/java-overrides/com/webtoapp/core/autostart/BootReceiver.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/autostart/BootReceiver.kt:137` 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 (46 lines × 2) app/src/main/java/com/webtoapp/core/errorpage/ErrorPageManager.kt:326— app/src/main/java/com/webtoapp/core/errorpage/ErrorPageManager.kt:326-371 | app/src/main/java/com/webtoapp/core/errorpage/ErrorPageManager.kt:484-529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/errorpage/ErrorPageManager.kt:326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (40 lines × 2) app/src/main/java/com/webtoapp/ui/components/LanguageSelector.kt:171— app/src/main/java/com/webtoapp/ui/components/LanguageSelector.kt:171-210 | app/src/main/java/com/webtoapp/ui/components/LanguageSelector.kt:409-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/LanguageSelector.kt:171` 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 (36–38 lines × 2) app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:54— app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:54-91 | app/src/main/java/com/webtoapp/ui/components/StatusBarBackground.kt:136-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/StatusBarBackground.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. 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 (36 lines × 2) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:169— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:169-204 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:153-188 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.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 (31–32 lines × 2) app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt:429— app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt:429-460 | app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.kt:636-666 — 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/webtoapp/core/notification/NotificationPollingService.kt:429` it does not close everything it opens, so those 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `notif` to `PollNotification` in one and `PushNotification` 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/webtoapp/core/notification/NotificationWebSocketService.kt:635` calls `incrementAndGet` and `app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt:427` 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 (31 lines × 2) app/src/main/java/com/webtoapp/ui/viewmodel/WebAppDraftBuilder.kt:100— app/src/main/java/com/webtoapp/ui/viewmodel/WebAppDraftBuilder.kt:100-130 | app/src/main/java/com/webtoapp/ui/viewmodel/WebAppDraftBuilder.kt:132-162 — both copies are in the same file, so extract the 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 (27–31 lines × 2) app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:1936— app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:1936-1962 | app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.kt:2066-2096 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/webview/WebViewActivity.kt:1936` it begins part-way through the construct above it, so those exact lines 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–30 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:370— app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:370-399 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:529-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:370` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (29 lines × 2) app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:137— app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:137-165 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:210-238 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt` and `app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt` as WHOLE FILES: this scan already matched 7 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/webtoapp/core/webview/LocalHttpToSocksBridge.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 (26–28 lines × 2) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:202— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:202-229 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:156-181 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/php/PhpAppRuntime.kt:202` it begins part-way through the construct above it, so those exact lines 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–28 lines × 2) app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:510— app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:510-534 | app/src/main/java/com/webtoapp/ui/screens/AiSettingsScreen.kt:708-735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/AiSettingsScreen.kt:510` 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–27 lines × 6) app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:139— app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:139-165 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:677-703 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:808-829 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:986-1008 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:1137-1159 | app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:1315-1336 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:139` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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/webtoapp/ui/shell/ShellServerModes.kt:1314` calls `i` and `app/src/main/java/com/webtoapp/ui/shell/ShellServerModes.kt:138` 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 (27 lines × 3) app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1001— app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1001-1027 | app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1045-1071 | app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt:1092-1118 — 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 (26–27 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1145— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1145-1170 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1876-1902 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/core/ai/AiApiClient.kt:1145` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (26 lines × 4) app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:118— app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:118-143 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:327-352 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:489-514 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:610-635 — 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/webtoapp/ui/components/LongPressMenu.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.
Duplicated block (23–26 lines × 2) app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:191— app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt:191-213 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:327-352 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/LrcEditorDialog.kt` and `app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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/webtoapp/ui/components/LrcEditorDialog.kt:191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 3) app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:474— app/src/main/java/com/webtoapp/core/nodejs/NodeDependencyManager.kt:474-498 | REDACTED:1305-1329 | app/src/main/java/com/webtoapp/core/wordpress/WordPressDependencyManager.kt:472-496 — 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/webtoapp/core/nodejs/NodeDependencyManager.kt:474` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–24 lines × 4) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:339— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:339-361 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:423-446 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:462-484 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:443-465 — 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.
Duplicated block (24 lines × 4) app/src/main/java/com/webtoapp/ui/shell/ShellLongPressMenu.kt:42— app/src/main/java/com/webtoapp/ui/shell/ShellLongPressMenu.kt:42-65 | app/src/main/java/com/webtoapp/ui/shell/ShellLongPressMenu.kt:70-93 | app/src/main/java/com/webtoapp/ui/shell/ShellLongPressMenu.kt:100-123 | app/src/main/java/com/webtoapp/ui/shell/ShellLongPressMenu.kt:130-153 — 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/webtoapp/ui/shell/ShellLongPressMenu.kt:42` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:813— app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:813-836 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:915-938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/components/LongPressMenu.kt:813` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–24 lines × 2) app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:845— app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:845-868 | app/src/main/java/com/webtoapp/ui/shell/ShellWebViewConfig.kt:141-163 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt:845` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–23 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1995— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1995-2017 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:478-497 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1995` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–23 lines × 2) app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:403— app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:403-424 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:262-284 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt` and `app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (23 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:887— app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:887-909 | app/src/main/java/com/webtoapp/ui/screens/CreateAppScreen.kt:974-996 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18–22 lines × 2) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1731— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1731-1748 | app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:122-143 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt` as WHOLE FILES: this scan already matched 7 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/ai/AiApiClient.kt:1731` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:120` calls `Suppress` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1729` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18–21 lines × 2) app/src/main/java/com/webtoapp/core/golang/GoBuildEnvironment.kt:34— app/src/main/java/com/webtoapp/core/golang/GoBuildEnvironment.kt:34-54 | app/src/main/java/com/webtoapp/core/golang/GoBuildEnvironment.kt:88-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/golang/GoBuildEnvironment.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/core/golang/GoBuildEnvironment.kt:55` calls `getGoBinary` and `app/src/main/java/com/webtoapp/core/golang/GoBuildEnvironment.kt:106` 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 (20 lines × 3) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:794— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:794-813 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1375-1394 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1641-1660 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–20 lines × 3) app/src/main/java/com/webtoapp/ui/components/IconLibraryDialog.kt:69— app/src/main/java/com/webtoapp/ui/components/IconLibraryDialog.kt:69-88 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1667-1682 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2110-2125 — 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/webtoapp/ui/components/IconLibraryDialog.kt:69` 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–20 lines × 3) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:431— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:431-450 | app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:941-959 | app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:1039-1057 — 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:431` 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–20 lines × 3) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:139— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:139-158 | app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:180-196 | app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:204-220 — 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/webtoapp/ui/shell/ShellMediaContent.kt:139` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–20 lines × 2) app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscReader.kt:74— app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscReader.kt:74-93 | app/src/main/java/com/webtoapp/core/playstore/aab/axml/AxmlReader.kt:202-219 — 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 (17–20 lines × 2) app/src/main/java/com/webtoapp/ui/screens/StatsScreen.kt:242— app/src/main/java/com/webtoapp/ui/screens/StatsScreen.kt:242-258 | app/src/main/java/com/webtoapp/ui/screens/StatsScreen.kt:544-563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/ui/screens/StatsScreen.kt:544` it begins part-way through the construct above it, so those exact lines 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 × 7) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1019— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1019-1037 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1070-1088 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1112-1130 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1153-1171 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1183-1201 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:286-304 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:316-334 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–18 lines × 5) app/src/main/java/com/webtoapp/ui/components/BackgroundRunConfigCard.kt:44— app/src/main/java/com/webtoapp/ui/components/BackgroundRunConfigCard.kt:44-59 | app/src/main/java/com/webtoapp/ui/components/BgmCard.kt:53-67 | app/src/main/java/com/webtoapp/ui/components/EncryptionConfigCard.kt:35-52 | app/src/main/java/com/webtoapp/ui/components/IsolationConfigCard.kt:51-68 | app/src/main/java/com/webtoapp/ui/components/NotificationConfigCard.kt:61-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 all 5 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/webtoapp/ui/components/BackgroundRunConfigCard.kt:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–18 lines × 2) app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscReader.kt:396— app/src/main/java/com/webtoapp/core/playstore/aab/arsc/ArscReader.kt:396-410 | app/src/main/java/com/webtoapp/core/playstore/aab/axml/AxmlReader.kt:297-314 — 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 (3–17 lines × 3) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlEditor.kt:315— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlEditor.kt:315-329 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2394-2410 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:689-691 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/apkbuilder/AxmlEditor.kt:315` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:689` calls `toInt` and `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlEditor.kt:315` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–17 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2413— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2413-2429 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:700-713 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (16 lines × 4) app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt:65— app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt:65-80 | app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt:89-104 | app/src/main/java/com/webtoapp/ui/components/PythonExtensionsCard.kt:65-80 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:928-943 — before extracting anything, compare `app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt` and `app/src/main/java/com/webtoapp/ui/components/PhpExtensionsCard.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/NodeExtensionsCard.kt:65` 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–16 lines × 4) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:137— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:137-150 | app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:178-188 | app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:202-212 | app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:452-467 — 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/webtoapp/ui/shell/ShellMediaContent.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–16 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2230— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2230-2245 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:614-625 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2230` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (15–16 lines × 2) app/src/main/java/com/webtoapp/util/FaviconFetcher.kt:225— app/src/main/java/com/webtoapp/util/FaviconFetcher.kt:225-240 | app/src/main/java/com/webtoapp/util/UrlMetadataFetcher.kt:219-233 — 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 (14 lines × 4) app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:186— app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:186-199 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:255-268 | app/src/main/java/com/webtoapp/ui/components/LongPressMenu.kt:548-561 | app/src/main/java/com/webtoapp/ui/screens/HostsAdBlockScreen.kt:579-592 — 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/webtoapp/ui/components/LongPressMenu.kt:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 4) app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:428— app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:428-440 | app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:938-949 | app/src/main/java/com/webtoapp/ui/gallery/GalleryPlayerScreen.kt:1036-1047 | app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:657-670 — 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/webtoapp/ui/gallery/GalleryPlayerScreen.kt:428` it begins part-way through the construct above it, so those exact lines 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–14 lines × 3) app/src/main/java/com/webtoapp/ui/components/WtaReorderableUrlList.kt:92— app/src/main/java/com/webtoapp/ui/components/WtaReorderableUrlList.kt:92-105 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:4638-4648 | app/src/main/java/com/webtoapp/ui/screens/CreateAppWebViewCards.kt:4774-4784 — 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/webtoapp/ui/components/WtaReorderableUrlList.kt:92` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–14 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:204— app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:204-217 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:560-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/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:204` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–14 lines × 2) app/src/main/java/com/webtoapp/util/IconStorage.kt:162— app/src/main/java/com/webtoapp/util/IconStorage.kt:162-172 | app/src/main/java/com/webtoapp/util/SplashStorage.kt:101-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 4) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1742— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1742-1754 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1840-1852 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1899-1911 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2067-2079 — 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1742` it does not close everything it opens, so those 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/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1759` calls `d` and `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1857` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 3) app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.kt:900— app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.kt:900-911 | app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.kt:1032-1044 | app/src/main/java/com/webtoapp/ui/screens/CreateAppApkSection.kt:1340-1352 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–13 lines × 3) app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:436— app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:436-448 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:875-885 | app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:374-384 — 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/webtoapp/ui/screens/CreateGalleryAppScreen.kt:436` it begins part-way through the construct above it, so those exact lines 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–13 lines × 2) app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:653— app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:653-662 | app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:944-956 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/components/ManualLrcAligner.kt:944` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–13 lines × 3) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:389— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:389-401 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:512-514 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:493-505 — 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/webtoapp/ui/screens/CreatePhpAppScreen.kt:512` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:402` calls `isNotEmpty` and `app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:506` 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–13 lines × 2) app/src/main/java/com/webtoapp/util/DownloadHelper.kt:503— app/src/main/java/com/webtoapp/util/DownloadHelper.kt:503-515 | app/src/main/java/com/webtoapp/util/DownloadHelper.kt:620-628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/webtoapp/util/DownloadHelper.kt:503` 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–12 lines × 7) app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:254— app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:254-260 | app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:404-409 | app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:685-690 | app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:733-738 | app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:838-843 | app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:893-898 | app/src/main/java/com/webtoapp/ui/screens/InstallProjectDepsCard.kt:87-98 — there are 7 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:254` it does not close everything it opens, so those 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/webtoapp/ui/screens/CreateMediaAppScreen.kt:682` calls `listOf` and `app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:731` 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–12 lines × 4) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:180— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:180-191 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:164-175 | app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:142-150 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:215-223 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:180` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–12 lines × 4) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:444— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:444-455 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:399-410 | app/src/main/java/com/webtoapp/core/webview/LocalHttpToSocksBridge.kt:267-276 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:723-732 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:444` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 8) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1021— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1021-1031 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1072-1082 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1114-1124 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1155-1165 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1185-1195 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:248-258 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:288-298 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:318-328 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1032` calls `putShort` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:259` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 6) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:934— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:934-944 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:970-980 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1016-1026 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1056-1066 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1465-1475 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1501-1511 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:934` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:945` calls `addProperty` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:1067` 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 × 4) app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:962— app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:962-971 | app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:989-998 | app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:1053-1063 | app/src/main/java/com/webtoapp/core/webview/DownloadBridge.kt:1083-1093 — 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/webtoapp/core/webview/DownloadBridge.kt:962` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10–11 lines × 3) app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1673— app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1673-1683 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:2116-2126 | app/src/main/java/com/webtoapp/ui/screens/WordPressSettingsScreen.kt:86-95 — 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/webtoapp/ui/screens/CreateHtmlAppScreen.kt:1673` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 3) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:343— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:343-352 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:281-289 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:704-712 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:354` calls `pumpRequestBodyIfPresent` and `app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:713` 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 × 4) app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:718— app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:718-726 | app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:2444-2452 | app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:27-35 | app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:89-97 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt` and `app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:718` it does not close everything it opens, so those 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/webtoapp/core/ai/AiApiClient.kt:2453` calls `getAsJsonObject` and `app/src/main/java/com/webtoapp/core/ai/AiApiClient.kt:727` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–9 lines × 2) app/src/main/java/com/webtoapp/core/notification/BridgeAlarmReceiver.kt:88— app/src/main/java/com/webtoapp/core/notification/BridgeAlarmReceiver.kt:88-96 | app/src/main/java/com/webtoapp/core/webview/NativeBridge.kt:907-912 — 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/webtoapp/core/notification/BridgeAlarmReceiver.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 (8 lines × 5) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1749— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1749-1756 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1847-1854 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1906-1913 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:2074-2081 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:528-535 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1759` calls `d` and `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:1857` 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–8 lines × 2) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:860— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:860-865 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:906-913 — both copies are in the same file, so extract the 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 (7 lines × 6) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1044— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1044-1050 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1331-1337 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1359-1365 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1380-1386 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1401-1407 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1439-1445 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1044` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 5) app/src/main/java/com/webtoapp/ui/shell/ShellLongPressMenu.kt:57— app/src/main/java/com/webtoapp/ui/shell/ShellLongPressMenu.kt:57-63 | app/src/main/java/com/webtoapp/ui/shell/ShellLongPressMenu.kt:85-91 | app/src/main/java/com/webtoapp/ui/shell/ShellLongPressMenu.kt:115-121 | app/src/main/java/com/webtoapp/ui/shell/ShellLongPressMenu.kt:145-151 | app/src/main/java/com/webtoapp/ui/webview/WebViewLongPressMenu.kt:36-42 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/shell/ShellLongPressMenu.kt:57` 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 × 3) app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:859— app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:859-865 | app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt:905-911 | app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt:526-532 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/apkbuilder/AxmlRebuilder.kt` and `app/src/main/java/com/webtoapp/core/appmodifier/CloneManifestRewriter.kt` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 3) app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:311— app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt:311-317 | app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt:248-254 | app/src/main/java/com/webtoapp/core/webview/TlsMitmBridge.kt:647-652 — before extracting anything, compare `app/src/main/java/com/webtoapp/core/linux/LocalDnsBridgeProxy.kt` and `app/src/main/java/com/webtoapp/core/webview/LocalHttpHostMappingBridge.kt` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 264 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/webtoapp/core/linux/LocalDnsBridgeProxy.kt:311` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–7 lines × 4) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:104— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:104-110 | app/src/main/java/com/webtoapp/ui/screens/CreateNodeJsAppScreen.kt:107-113 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:118-124 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:104-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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/webtoapp/ui/screens/CreateGoAppScreen.kt:104` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 7) app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1043— app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1043-1048 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1164-1169 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1330-1335 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1358-1363 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1379-1384 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1400-1405 | app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt:1438-1443 — 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/webtoapp/core/engine/GeckoViewEngine.kt:1043` it begins part-way through the construct above it, so those exact lines 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–6 lines × 2) app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:210— app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:210-215 | app/src/main/java/com/webtoapp/ui/screens/create/runtime/PythonProjectImportAnalyzer.kt:205-209 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 5) app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:82— app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt:82-86 | app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:69-73 | app/src/main/java/com/webtoapp/ui/screens/CreateGalleryAppScreen.kt:1512-1516 | app/src/main/java/com/webtoapp/ui/screens/CreateHtmlAppScreen.kt:124-128 | app/src/main/java/com/webtoapp/ui/screens/CreateMediaAppScreen.kt:62-66 — there are 5 copies across 4 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/webtoapp/ui/screens/CreateFrontendAppScreen.kt:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 3) app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:69— app/src/main/java/com/webtoapp/ui/screens/CreateGoAppScreen.kt:69-73 | app/src/main/java/com/webtoapp/ui/screens/CreatePhpAppScreen.kt:83-87 | app/src/main/java/com/webtoapp/ui/screens/CreatePythonAppScreen.kt:70-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. 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 × 4) app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:472— app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:472-479 | app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:533-542 | app/src/main/java/com/webtoapp/core/python/PythonRuntime.kt:926-933 | app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.kt:382-392 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 5) app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:140— app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:140-154 | app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:181-192 | app/src/main/java/com/webtoapp/ui/shell/ShellMediaContent.kt:205-216 | app/src/main/java/com/webtoapp/ui/splash/SplashLauncherActivity.kt:456-471 | app/src/main/java/com/webtoapp/ui/webview/WebViewSplashOverlay.kt:122-137 — 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/webtoapp/ui/shell/ShellMediaContent.kt:140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Outbound HTTP without resilience app/src/main/java/com/webtoapp/core/webview/TranslateProxyRoute.kt:54— `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
SC1 · Supply-chain hygiene· Go module dependencies are not locked · ×1
Go module dependencies are not locked — There is a REDACTED but no go.sum — module versions aren't pinned to a verified hash, so builds aren't reproducible (SSDF PW.4.4). Run `go mod tidy` and commit go.sum; keep `GOFLAGS=-mod=readonly` in CI so a build fails rather than silently resolving a new version. Advisory — never scored.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×1
Recursive walk over a caller-supplied document has no depth cap app/src/main/java/com/webtoapp/data/converter/Converters.kt:155— `Converters.mergeMissingDefaults` is public and takes `defaults: JsonElement` from its caller, and it calls itself at line 155 with a piece of `defaults` — the function is not `tailrec`, so every call is a real frame — and nowhere in `Converters.mergeMissingDefaults` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `Converters.mergeMissingDefaults` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
README/code drift docs/index.md:51— docs/index.md links to `/guide/app-types/`, but `guide/app-types` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:51— docs/index.md links to `/guide/app-types/web`, but `guide/app-types/web` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:51— docs/index.md links to `/guide/app-types/html`, but `guide/app-types/html` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:51— docs/index.md links to `/guide/app-types/frontend`, but `guide/app-types/frontend` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:51— docs/index.md links to `/guide/app-types/nodejs`, but `guide/app-types/nodejs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:51— docs/index.md links to `/guide/app-types/php`, but `guide/app-types/php` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:51— docs/index.md links to `/guide/app-types/python`, but `guide/app-types/python` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:51— docs/index.md links to `/guide/app-types/go`, but `guide/app-types/go` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:51— docs/index.md links to `/guide/app-types/wordpress`, but `guide/app-types/wordpress` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:51— docs/index.md links to `/guide/more-features/about`, but `guide/more-features/about` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:55— docs/index.md links to `/guide/config/`, but `guide/config` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:59— docs/index.md links to `/guide/app-actions/build-apk`, but `guide/app-actions/build-apk` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:59— docs/index.md links to `/guide/app-actions/share-apk`, but `guide/app-actions/share-apk` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:59— docs/index.md links to `/guide/app-actions/export-apk`, but `guide/app-actions/export-apk` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:59— docs/index.md links to `/guide/more-features/google-play`, but `guide/more-features/google-play` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:69— docs/index.md links to `/guide/app-types/multi-web`, but `guide/app-types/multi-web` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:109— docs/index.md links to `/guide/app-types/media`, but `guide/app-types/media` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:123— docs/index.md links to `/guide/more-features/agent`, but `guide/more-features/agent` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:131— docs/index.md links to `/guide/more-features/extension-modules`, but `guide/more-features/extension-modules` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:139— docs/index.md links to `/guide/more-features/hosts-adblock`, but `guide/more-features/hosts-adblock` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:147— docs/index.md links to `/guide/more-features/linux-environment`, but `guide/more-features/linux-environment` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:155— docs/index.md links to `/guide/more-features/port-manager`, but `guide/more-features/port-manager` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:163— docs/index.md links to `/guide/more-features/app-modifier`, but `guide/more-features/app-modifier` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:185— docs/index.md links to `/developer/architecture`, but `developer/architecture` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/index.md:191— docs/index.md links to `/guide/getting-started`, but `guide/getting-started` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Silent fallback default in catch app/src/main/java/com/webtoapp/core/agent/files/ProjectFileManager.kt:114— `countLines` 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/webtoapp/core/apkbuilder/ApkBuilder.kt:3594— `detectFileEncoding` swallows every exception into `"UTF-8"` — 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/webtoapp/core/bgm/BgmPlayer.kt:220— `getCurrentPosition` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/java/com/webtoapp/core/bgm/BgmPlayer.kt:228— `getDuration` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/java/com/webtoapp/core/extension/ChromeExtensionParser.kt:322— `extractBackgroundScript` 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/webtoapp/core/extension/ChromeExtensionRuntime.kt:899— `extractDefaultPopupFromManifest` 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/webtoapp/core/extension/ChromeExtensionRuntime.kt:1045— `deriveOriginUrl` swallows every exception into `"about:blank"` — 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/webtoapp/core/extension/ChromeHostPermissions.kt:32— `declaredPatterns` 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/webtoapp/core/extension/ChromeHostPermissions.kt:81— `contentScriptRules` 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/webtoapp/core/extension/DeclarativeNetRequestEngine.kt:206— `extractHost` 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/webtoapp/core/extension/DeclarativeNetRequestEngine.kt:630— `parseIntArray` 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/webtoapp/core/extension/DeclarativeNetRequestEngine.kt:643— `parseStringArray` 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/webtoapp/core/frontend/SampleProjectManager.kt:109— `getAppVersionCode` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/java/com/webtoapp/core/golang/GoRuntime.kt:478— `getProcessPid` 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/webtoapp/core/golang/GoToolchainManager.kt:107— `usableBytes` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/java/com/webtoapp/core/golang/GoToolchainManager.kt:177— `directorySize` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/java/com/webtoapp/core/logging/AppLogger.kt:559— `getAppVersion` swallows every exception into `"N/A"` — 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/webtoapp/core/logging/AppLogger.kt:568— `getAvailableMemory` 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/webtoapp/core/logging/AppLogger.kt:577— `getUsedMemory` 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/webtoapp/core/network/CnMirrorProbe.kt:195— `measureLatency` 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/webtoapp/core/nodejs/NodeDependencyManager.kt:533— `systemPageSize` swallows every exception into `4096` — 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/webtoapp/core/perf/NativePerfEngine.kt:150— `matchHostSuffix` 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/webtoapp/core/perf/NativeSysOptimizer.kt:67— `getMaxThermalTemp` 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/webtoapp/core/php/PhpAppRuntime.kt:539— `getProcessPid` 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/webtoapp/core/plugin/PluginMigrator.kt:287— `sidecar` 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.
Duplicated predicate app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt:339— `!File(projectDir, "index.php").exists() && File(projectDir, "public/index.php").exists()` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt, app/src/main/java/com/webtoapp/ui/screens/create/runtime/PhpProjectImportAnalyzer.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/webtoapp/core/php/PhpAppRuntime.kt:80— `!com.webtoapp.core.linux.RuntimeExecPolicy.canExecAppDataBinaries(context) && !com.webtoapp.core.linux.RuntimeExecPolicy.hasStaticExecBridge…` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt, app/src/main/java/com/webtoapp/core/wordpress/WordPressPhpRuntime.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/webtoapp/core/floatingwindow/FloatingWindowManager.kt:1204— `!config.lockAspectRatio && config.aspectRatioMode == FloatingWindowAspectRatioMode.SCREEN` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/floatingwindow/FloatingWindowManager.kt, app/src/main/java/com/webtoapp/ui/components/FloatingWindowConfigCard.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/webtoapp/core/apkbuilder/ApkBuilder.kt:2709— `!file.isFile || !file.canRead() || file.length() <= 0L` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt, app/src/main/java/com/webtoapp/util/NetworkTrustStorage.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/webtoapp/ui/shell/ShellActivity.kt:1047— `!isFinishing && !isChangingConfigurations` appears character-identically in 2 files — app/src/main/java/com/webtoapp/ui/shell/ShellActivity.kt, app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.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/webtoapp/ui/MainActivity.kt:69— `!isTaskRoot && intent?.action == Intent.ACTION_MAIN && intent?.hasCategory(Intent.CATEGORY_LAUNCHER) == true` appears character-identically in 2 files — app/src/main/java/com/webtoapp/ui/MainActivity.kt, app/src/main/java/com/webtoapp/ui/shell/ShellActivity.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/webtoapp/util/FaviconFetcher.kt:190— `!normalized.startsWith("http://") && !normalized.startsWith("https://")` appears character-identically in 2 files — app/src/main/java/com/webtoapp/util/FaviconFetcher.kt, app/src/main/java/com/webtoapp/util/UrlMetadataFetcher.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/webtoapp/core/frontend/FrontendProjectBuilder.kt:56— `!outputDir.exists() || !outputDir.isDirectory` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/frontend/FrontendProjectBuilder.kt, app/src/main/java/com/webtoapp/util/HtmlProjectHelper.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/webtoapp/core/scraper/StaticAssetScraper.kt:83— `!path.contains(".") || path.substringAfterLast(".").length > 10` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/scraper/StaticAssetScraper.kt, REDACTED. 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/webtoapp/core/apkbuilder/ApkArtifactVerifier.kt:338— `!projectDir.exists() || !projectDir.isDirectory` appears character-identically in 6 files — app/src/main/java/com/webtoapp/core/apkbuilder/ApkArtifactVerifier.kt, app/src/main/java/com/webtoapp/ui/screens/FileManagerScreen.kt, app/src/main/java/com/webtoapp/ui/screens/create/runtime/GoProjectImportAnalyzer.kt, app/src/main/java/com/webtoapp/ui/screens/create/runtime/NodeJsProjectImportAnalyzer.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/webtoapp/ui/screens/CreateFrontendAppScreen.kt:1120— `!rootDoc.exists() || !rootDoc.isDirectory` appears character-identically in 2 files — app/src/main/java/com/webtoapp/ui/screens/CreateFrontendAppScreen.kt, app/src/main/java/com/webtoapp/ui/screens/create/runtime/GoProjectSourceLoader.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/webtoapp/core/apkbuilder/ApkBuilder.kt:3505— `!sourceFile.exists() || !sourceFile.canRead()` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt, app/src/main/java/com/webtoapp/util/HtmlProjectHelper.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/webtoapp/core/webview/WebViewManager.kt:4380— `!trimmed.startsWith("http://", ignoreCase = true) && !trimmed.startsWith("https://", ignoreCase = true)` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/webview/WebViewManager.kt, app/src/main/java/com/webtoapp/ui/shell/ShellUtils.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/webtoapp/core/webview/DocumentDownloadPolicy.kt:40— `!url.startsWith("http://") && !url.startsWith("https://")` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/webview/DocumentDownloadPolicy.kt, app/src/main/java/com/webtoapp/core/webview/WebViewResumeStore.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/webtoapp/util/IconStorage.kt:167— `(halfHeight / inSampleSize) >= reqHeight && (halfWidth / inSampleSize) >= reqWidth` appears character-identically in 2 files — app/src/main/java/com/webtoapp/util/IconStorage.kt, app/src/main/java/com/webtoapp/util/SplashStorage.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/webtoapp/core/shell/ShellModeManager.kt:988— `(type == "LOCAL" || type == "INLINE_HTML" || (type == "EXISTING" && localFilePath.isNotBlank())) && localFilePath.isNotBlank()` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/shell/ShellModeManager.kt, app/src/main/java/com/webtoapp/data/model/WebApp.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/webtoapp/core/crypto/IntegrityChecker.kt:170— `Build.FINGERPRINT.startsWith("generic") || Build.FINGERPRINT.startsWith("unknown") || Build.MODEL.contains("google_sdk") || Build.MODEL.cont…` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/crypto/IntegrityChecker.kt, app/src/main/java/com/webtoapp/core/crypto/RuntimeProtection.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/webtoapp/core/notification/NotificationPollingService.kt:425— `Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && ContextCompat.checkSelfPermission(this, android.Manifest.permission.POST_NOTIFICATI…` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/notification/NotificationPollingService.kt, app/src/main/java/com/webtoapp/core/notification/NotificationWebSocketService.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/webtoapp/core/php/PhpAppRuntime.kt:326— `File(projectDir, "routes").isDirectory && File(projectDir, "public/index.php").exists()` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt, app/src/main/java/com/webtoapp/ui/screens/create/runtime/PhpProjectImportAnalyzer.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/webtoapp/core/php/PhpAppRuntime.kt:311— `File(projectDir, "spark").exists() || File(projectDir, "system/CodeIgniter.php").exists()` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/php/PhpAppRuntime.kt, app/src/main/java/com/webtoapp/ui/screens/create/runtime/PhpProjectImportAnalyzer.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/webtoapp/core/adblock/AdBlocker.kt:988— `accept.contains("font/") || accept.contains("application/font")` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt, app/src/main/java/com/webtoapp/core/webview/WebViewManager.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/webtoapp/ui/shell/ShellPermissionDelegate.kt:336— `acceptTypes == null || acceptTypes.isEmpty() || (acceptTypes.size == 1 && acceptTypes[0].isNullOrBlank())` appears character-identically in 2 files — app/src/main/java/com/webtoapp/ui/shell/ShellPermissionDelegate.kt, app/src/main/java/com/webtoapp/ui/webview/WebViewActivity.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/webtoapp/core/engine/GeckoViewEngine.kt:1045— `activity == null || activity.isFinishing || activity.isDestroyed` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/engine/GeckoViewEngine.kt, app/src/main/java/com/webtoapp/core/webview/WebViewManager.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/webtoapp/core/download/DependencyDownloadEngine.kt:383— `actual == null || !actual.equals(expectedSha256, ignoreCase = true)` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/download/DependencyDownloadEngine.kt, app/src/main/java/com/webtoapp/core/update/ApkUpdateInstaller.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/webtoapp/core/apkbuilder/ApkBuilder.kt:3982— `appType != "HTML" && appType != "FRONTEND"` appears character-identically in 2 files — app/src/main/java/com/webtoapp/core/apkbuilder/ApkBuilder.kt, app/src/main/java/com/webtoapp/core/apkbuilder/AppContentEmbedder.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.
Hand-rolled JSON/XML parsing via regex app/src/main/java/com/webtoapp/core/agent/export/SessionArtifactDetector.kt:343— 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/webtoapp/core/ai/ApiKeyRotation.kt:172— 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/webtoapp/core/ai/ApiKeyRotation.kt:174— 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/webtoapp/core/ai/ApiKeyRotation.kt:310— 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/webtoapp/core/linux/PureBuildEngine.kt:17— 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/webtoapp/core/plugin/PluginModels.kt:43— 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/webtoapp/core/plugin/PluginModels.kt:48— 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/webtoapp/core/stats/BatchImportService.kt:20— 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/webtoapp/core/stats/BatchImportService.kt:21— 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/webtoapp/ui/shell/MultiWebShellMode.kt:1587— 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/webtoapp/util/UrlMetadataFetcher.kt:27— 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.
Documentation: written for insiders docs/developer/index.md— The repository layout table lists paths like `app/src/main/java/com/webtoapp` but does not explain what resides under them (e.g. runtime sources, synced shell files) so the reader cannot decode the jargon. Add a brief description of each path's role in the README or an inline note mapping host-only app/ to the synced shell trees.
Documentation: written for insiders docs/extensions/index.md— The HCJ plugin overview describes `hcj.*` and `plugin.json`, but it never explains what the native HTML+CSS+JS package actually looks like (the visible file tree, the hcj/page script type, or how to run a standalone HTML file). Add an 'Instantiating an HCJ plugin' section showing the bare plugin.html and its page-script contract.
Orphaned file app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 38 project(s) overshoot their size bounds, lowering Project Cohesion to 9.5/10. The most over is `app` (303675 LoC, 3180 module-visible types across 128 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 2 of 598 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 598 of the 734 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: app/src/main/java/com/webtoapp/core/ai/provider/AiResponseParser.kt, app/src/main/java/com/webtoapp/core/ai/provider/AiImageSupport.kt. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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.
Logging is not universal — Only 4/34 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `app/src/main/assets/sample_projects/go-fiber`, `app/src/main/assets/sample_projects/go-fiber-ar`, `app/src/main/assets/sample_projects/go-fiber-en`, `app/src/main/assets/sample_projects/go-gin`, `app/src/main/assets/sample_projects/go-gin-ar` and 25 more.
No SAST — No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 15094 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 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/19 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.
Outdated: github.com/gin-gonic/gin — `github.com/gin-gonic/gin` is required at v1.9.1 in app/src/main/assets/sample_projects/go-gin-ar/go.mod, but v1.12.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/gin-gonic/gin@v1.12.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/gin-gonic/gin — `github.com/gin-gonic/gin` is required at v1.9.1 in app/src/main/assets/sample_projects/go-gin-en/go.mod, but v1.12.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/gin-gonic/gin@v1.12.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/gin-gonic/gin — `github.com/gin-gonic/gin` is required at v1.9.1 in app/src/main/assets/sample_projects/go-gin/go.mod, but v1.12.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/gin-gonic/gin@v1.12.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/labstack/echo/v4 — `github.com/labstack/echo/v4` is required at v4.11.4 in REDACTED, but v4.16.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/labstack/echo/v4@v4.16.2 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/labstack/echo/v4 — `github.com/labstack/echo/v4` is required at v4.11.4 in app/src/main/assets/sample_projects/go-echo-en/go.mod, but v4.16.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/labstack/echo/v4@v4.16.2 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/labstack/echo/v4 — `github.com/labstack/echo/v4` is required at v4.11.4 in app/src/main/assets/sample_projects/go-echo/go.mod, but v4.16.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/labstack/echo/v4@v4.16.2 && go mod tidy` and commit the updated REDACTED and go.sum.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 49 file(s) — `app/src/main/java/com/webtoapp/WebToAppApplication.kt`, `app/src/main/java/com/webtoapp/core/adblock/AdBlocker.kt`, `app/src/main/java/com/webtoapp/core/ads/api/AdsFeatureApi.kt`, `app/src/main/java/com/webtoapp/core/agent/files/ProjectFileManager.kt`, `app/src/main/java/com/webtoapp/core/agent/tool/builtin/AppLifecycleTools.kt`, … (+44 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a16fb0-8439-75cc-8078-0ecdc1f274b0 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 27 · Warnings: 1652 · Recommendations: 132 · Info: 6 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 24-10-2026 @ 20:53 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.