Public report of phsycologicalFudge/AvarionX-Android-Antivirus, published 17 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 17 November 2026, 11:59 UTC · Survey ID cd_7a89f4ad170d4bd5954b082f496df4cd
phsycologicalFudge/AvarionX-Android-Antivirus
Measured 17 November 2026, 11:58 UTC, at code version ce06880
First survey, so nothing to compare with yet
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 166,070 lines of product code in 6 projects, tests not counted · Estimated rebuild effort: about 0.6 person-years · Weakest lens: Production Readiness, 42.6
Findings by how serious they are
7 critical763 serious68 minor
9 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 11:58 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
36of 36 dimensions measured by tools.
831of 838 findings point to an exact file and line, so you can open each one in the code. The other 7 concern the repository as a whole, such as missing documentation.
36dimensions across 6 lenses, read from 166,070 lines of product code in 6 projects.
phsycologicalFudge/AvarionX-Android-Antivirus falls short of our standard for production because we found no working pipeline that builds or tests changes to the code and no automated security scanning of the code, its secrets or its dependencies. It scores 51.9 out of 100 and is rated Adequate, and all seven of its critical findings are security problems in its code.
Production Readiness, at 42.6, is the weakest lens and counts most in the score. The best first step for the work it takes is recording design decisions, worth about 3.9 points. Adding an automated build and test pipeline would lift Production Readiness itself, worth about 7.0 points. Raising Production Readiness to 70 would lift the score to about 59.3.
Seven weaknesses in the code could be used by an attacker. Fixing the weaknesses the scanner points to would close this risk.
The product code is 166,070 lines, about €86,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 42.6 to 70, the lowest score rated Strong, the score would rise from 51.9 to about 59.3.
Code composition: what the lines of code areMost of the hand-written code is supporting code, such as wiring, settings and declarations, and business logic is 0% of it. That is normal for a service that mainly connects other systems or stores and fetches records, and worth a look if this product is meant to hold complex business rules.
Supporting code 100%Tests 0%
Rebuild cost: about €86,000 · Estimate
Cost to rebuild
€30,000 to €140,000, for 500 to 1,498 hours of work, about 0.6 person-years for 1 to 2 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 52. 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: 166,070 lines of product code
Comment lines
The estimate prices 131,572 lines. Comment lines count towards the size of 166,070 lines but aren't priced as work.
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.dart.
Raises the score by about 3.9 points · Low effort · ADR Quality
2
Add a CI workflow that builds and runs the test suite on every push/PR.
Raises the score by about 7.0 points · Medium effort · CI/CD gates
3
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.
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 €86,000 to build again, about 0.6 person-years of work. Its weakest lens is Production Readiness, at 42.6 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 3.9 points for low effort, because it clears the 1 ADR Quality 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.6 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 8% on every change. The history of the code shows how much it changes: about 61,080 lines over the last 90 days, which is about 247,713 lines a year. At that pace, the extra work comes to an estimated 22.2 to 132.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
53 modules, with 34 dependencies between them. 3 loops run through 6 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 13 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.
com.colourswift.cssecurity.rtp.SystemWatcher uses com.colourswift.cssecurity.rtp, so a change to com.colourswift.cssecurity.rtp can break com.colourswift.cssecurity.rtp.SystemWatcher, while a change to com.colourswift.cssecurity.rtp.SystemWatcher can't break com.colourswift.cssecurity.rtp.
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.
20→32 com.colourswift.cssecurity.terminal.input uses com.colourswift.cssecurity.terminal.emulatorpart of a loop✕
Connections
1 pair of types, where a type in com.colourswift.cssecurity.terminal.input uses a type in com.colourswift.cssecurity.terminal.emulator.
com.colourswift.cssecurity.terminal.input uses com.colourswift.cssecurity.terminal.emulator, so a change to com.colourswift.cssecurity.terminal.emulator can break com.colourswift.cssecurity.terminal.input, while a change to com.colourswift.cssecurity.terminal.input can't break com.colourswift.cssecurity.terminal.emulator.
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.
1 pair of types, where a type in com.colourswift.cssecurity.vpn.backend_port.health uses a type in com.colourswift.cssecurity.vpn.backend_port.health.TunnelProbe.
com.colourswift.cssecurity.vpn.backend_port.health uses com.colourswift.cssecurity.vpn.backend_port.health.TunnelProbe, so a change to com.colourswift.cssecurity.vpn.backend_port.health.TunnelProbe can break com.colourswift.cssecurity.vpn.backend_port.health, while a change to com.colourswift.cssecurity.vpn.backend_port.health can't break com.colourswift.cssecurity.vpn.backend_port.health.TunnelProbe.
Position
Below the diagonal: com.colourswift.cssecurity.vpn.backend_port.health uses a module listed above it, which is the healthy direction.
21→33 com.colourswift.cssecurity.vpn.backend_port.health uses com.colourswift.cssecurity.vpn.backend_port.corepart of a loop✕
Connections
1 pair of types, where a type in com.colourswift.cssecurity.vpn.backend_port.health uses a type in com.colourswift.cssecurity.vpn.backend_port.core.
com.colourswift.cssecurity.vpn.backend_port.health uses com.colourswift.cssecurity.vpn.backend_port.core, so a change to com.colourswift.cssecurity.vpn.backend_port.core can break com.colourswift.cssecurity.vpn.backend_port.health, while a change to com.colourswift.cssecurity.vpn.backend_port.health can't break com.colourswift.cssecurity.vpn.backend_port.core.
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.
1 pair of types, where a type in com.colourswift.cssecurity.vpn.backend_port.network uses a type in com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient.
com.colourswift.cssecurity.vpn.backend_port.network uses com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient, so a change to com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient can break com.colourswift.cssecurity.vpn.backend_port.network, while a change to com.colourswift.cssecurity.vpn.backend_port.network can't break com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient.
Position
Below the diagonal: com.colourswift.cssecurity.vpn.backend_port.network uses a module listed above it, which is the healthy direction.
5 pairs of types, where a type in com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient.ProvisionResult uses a type in com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient.
com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient.ProvisionResult uses com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient, so a change to com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient can break com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient.ProvisionResult, while a change to com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient.ProvisionResult can't break com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient.
Position
Below the diagonal: com.colourswift.cssecurity.vpn.backend_port.network.VpnApiClient.ProvisionResult uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com.colourswift.cssecurity.vpn.backend_port.storage uses a type in com.colourswift.cssecurity.vpn.backend_port.storage.VpnIdentityStore.
com.colourswift.cssecurity.vpn.backend_port.storage uses com.colourswift.cssecurity.vpn.backend_port.storage.VpnIdentityStore, so a change to com.colourswift.cssecurity.vpn.backend_port.storage.VpnIdentityStore can break com.colourswift.cssecurity.vpn.backend_port.storage, while a change to com.colourswift.cssecurity.vpn.backend_port.storage can't break com.colourswift.cssecurity.vpn.backend_port.storage.VpnIdentityStore.
Position
Below the diagonal: com.colourswift.cssecurity.vpn.backend_port.storage uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.vpn.wireguard.CSWireGuardService uses com.colourswift.cssecurity.vpn.wireguard, so a change to com.colourswift.cssecurity.vpn.wireguard can break com.colourswift.cssecurity.vpn.wireguard.CSWireGuardService, while a change to com.colourswift.cssecurity.vpn.wireguard.CSWireGuardService can't break com.colourswift.cssecurity.vpn.wireguard.
Position
Below the diagonal: com.colourswift.cssecurity.vpn.wireguard.CSWireGuardService uses a module listed above it, which is the healthy direction.
fr.g123k.deviceapps uses fr.g123k.deviceapps.listener, so a change to fr.g123k.deviceapps.listener can break fr.g123k.deviceapps, while a change to fr.g123k.deviceapps can't break fr.g123k.deviceapps.listener.
Position
Below the diagonal: fr.g123k.deviceapps uses a module listed above it, which is the healthy direction.
io.github.parassharmaa.usage_stats uses io.github.parassharmaa.usage_stats.NetworkStats, so a change to io.github.parassharmaa.usage_stats.NetworkStats can break io.github.parassharmaa.usage_stats, while a change to io.github.parassharmaa.usage_stats can't break io.github.parassharmaa.usage_stats.NetworkStats.
Position
Below the diagonal: io.github.parassharmaa.usage_stats uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in io.github.parassharmaa.usage_stats.NetworkStats.NetworkType uses a type in io.github.parassharmaa.usage_stats.NetworkStats.
io.github.parassharmaa.usage_stats.NetworkStats.NetworkType uses io.github.parassharmaa.usage_stats.NetworkStats, so a change to io.github.parassharmaa.usage_stats.NetworkStats can break io.github.parassharmaa.usage_stats.NetworkStats.NetworkType, while a change to io.github.parassharmaa.usage_stats.NetworkStats.NetworkType can't break io.github.parassharmaa.usage_stats.NetworkStats.
Position
Below the diagonal: io.github.parassharmaa.usage_stats.NetworkStats.NetworkType uses a module listed above it, which is the healthy direction.
repository.screens uses repository.services, so a change to repository.services can break repository.screens, while a change to repository.screens can't break repository.services.
Position
Below the diagonal: repository.screens uses a module listed above it, which is the healthy direction.
repository.screens uses repository.src, so a change to repository.src can break repository.screens, while a change to repository.screens can't break repository.src.
Position
Below the diagonal: repository.screens uses a module listed above it, which is the healthy direction.
repository.screens uses repository.terminal, so a change to repository.terminal can break repository.screens, while a change to repository.screens can't break repository.terminal.
Position
Below the diagonal: repository.screens uses a module listed above it, which is the healthy direction.
repository.screens uses repository.translations, so a change to repository.translations can break repository.screens, while a change to repository.screens can't break repository.translations.
Position
Below the diagonal: repository.screens uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.rtp uses com.colourswift.cssecurity.rtp.SystemWatcherUserService, so a change to com.colourswift.cssecurity.rtp.SystemWatcherUserService can break com.colourswift.cssecurity.rtp, while a change to com.colourswift.cssecurity.rtp can't break com.colourswift.cssecurity.rtp.SystemWatcherUserService.
Position
Below the diagonal: com.colourswift.cssecurity.rtp uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.rtp uses com.colourswift.cssecurity.rtp.SystemWatcher, so a change to com.colourswift.cssecurity.rtp.SystemWatcher can break com.colourswift.cssecurity.rtp, while a change to com.colourswift.cssecurity.rtp can't break com.colourswift.cssecurity.rtp.SystemWatcher.
Position
Below the diagonal: com.colourswift.cssecurity.rtp uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.terminal.emulator uses com.colourswift.cssecurity.terminal.render, so a change to com.colourswift.cssecurity.terminal.render can break com.colourswift.cssecurity.terminal.emulator, while a change to com.colourswift.cssecurity.terminal.emulator can't break com.colourswift.cssecurity.terminal.render.
Position
Below the diagonal: com.colourswift.cssecurity.terminal.emulator uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.terminal.emulator uses com.colourswift.cssecurity.terminal.util, so a change to com.colourswift.cssecurity.terminal.util can break com.colourswift.cssecurity.terminal.emulator, while a change to com.colourswift.cssecurity.terminal.emulator can't break com.colourswift.cssecurity.terminal.util.
Position
Below the diagonal: com.colourswift.cssecurity.terminal.emulator uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.terminal.emulator uses com.colourswift.cssecurity.terminal.input, so a change to com.colourswift.cssecurity.terminal.input can break com.colourswift.cssecurity.terminal.emulator, while a change to com.colourswift.cssecurity.terminal.emulator can't break com.colourswift.cssecurity.terminal.input.
Position
Below the diagonal: com.colourswift.cssecurity.terminal.emulator uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.vpn.backend_port.core uses com.colourswift.cssecurity.vpn.backend_port.health, so a change to com.colourswift.cssecurity.vpn.backend_port.health can break com.colourswift.cssecurity.vpn.backend_port.core, while a change to com.colourswift.cssecurity.vpn.backend_port.core can't break com.colourswift.cssecurity.vpn.backend_port.health.
Position
Below the diagonal: com.colourswift.cssecurity.vpn.backend_port.core uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity uses com.colourswift.cssecurity.StorageRoots, so a change to com.colourswift.cssecurity.StorageRoots can break com.colourswift.cssecurity, while a change to com.colourswift.cssecurity can't break com.colourswift.cssecurity.StorageRoots.
Position
Below the diagonal: com.colourswift.cssecurity uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity uses com.colourswift.cssecurity.rtp, so a change to com.colourswift.cssecurity.rtp can break com.colourswift.cssecurity, while a change to com.colourswift.cssecurity can't break com.colourswift.cssecurity.rtp.
Position
Below the diagonal: com.colourswift.cssecurity uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity uses com.colourswift.cssecurity.vpn.backend_port.core, so a change to com.colourswift.cssecurity.vpn.backend_port.core can break com.colourswift.cssecurity, while a change to com.colourswift.cssecurity can't break com.colourswift.cssecurity.vpn.backend_port.core.
Position
Below the diagonal: com.colourswift.cssecurity uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.terminal.bridge uses com.colourswift.cssecurity.terminal.emulator, so a change to com.colourswift.cssecurity.terminal.emulator can break com.colourswift.cssecurity.terminal.bridge, while a change to com.colourswift.cssecurity.terminal.bridge can't break com.colourswift.cssecurity.terminal.emulator.
Position
Below the diagonal: com.colourswift.cssecurity.terminal.bridge uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.terminal.view uses com.colourswift.cssecurity.terminal.render, so a change to com.colourswift.cssecurity.terminal.render can break com.colourswift.cssecurity.terminal.view, while a change to com.colourswift.cssecurity.terminal.view can't break com.colourswift.cssecurity.terminal.render.
Position
Below the diagonal: com.colourswift.cssecurity.terminal.view uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.terminal.view uses com.colourswift.cssecurity.terminal.util, so a change to com.colourswift.cssecurity.terminal.util can break com.colourswift.cssecurity.terminal.view, while a change to com.colourswift.cssecurity.terminal.view can't break com.colourswift.cssecurity.terminal.util.
Position
Below the diagonal: com.colourswift.cssecurity.terminal.view uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.terminal.view uses com.colourswift.cssecurity.terminal.input, so a change to com.colourswift.cssecurity.terminal.input can break com.colourswift.cssecurity.terminal.view, while a change to com.colourswift.cssecurity.terminal.view can't break com.colourswift.cssecurity.terminal.input.
Position
Below the diagonal: com.colourswift.cssecurity.terminal.view uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.terminal.view uses com.colourswift.cssecurity.terminal.emulator, so a change to com.colourswift.cssecurity.terminal.emulator can break com.colourswift.cssecurity.terminal.view, while a change to com.colourswift.cssecurity.terminal.view can't break com.colourswift.cssecurity.terminal.emulator.
Position
Below the diagonal: com.colourswift.cssecurity.terminal.view uses a module listed above it, which is the healthy direction.
6 pairs of types, where a type in com.colourswift.cssecurity.vpn.backend_port.core.VpnRuntimeState uses a type in com.colourswift.cssecurity.vpn.backend_port.core.
com.colourswift.cssecurity.vpn.backend_port.core.VpnRuntimeState uses com.colourswift.cssecurity.vpn.backend_port.core, so a change to com.colourswift.cssecurity.vpn.backend_port.core can break com.colourswift.cssecurity.vpn.backend_port.core.VpnRuntimeState, while a change to com.colourswift.cssecurity.vpn.backend_port.core.VpnRuntimeState can't break com.colourswift.cssecurity.vpn.backend_port.core.
Position
Below the diagonal: com.colourswift.cssecurity.vpn.backend_port.core.VpnRuntimeState uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com.colourswift.cssecurity.vpn.backend_port.core.VpnTransport uses a type in com.colourswift.cssecurity.vpn.backend_port.core.
com.colourswift.cssecurity.vpn.backend_port.core.VpnTransport uses com.colourswift.cssecurity.vpn.backend_port.core, so a change to com.colourswift.cssecurity.vpn.backend_port.core can break com.colourswift.cssecurity.vpn.backend_port.core.VpnTransport, while a change to com.colourswift.cssecurity.vpn.backend_port.core.VpnTransport can't break com.colourswift.cssecurity.vpn.backend_port.core.
Position
Below the diagonal: com.colourswift.cssecurity.vpn.backend_port.core.VpnTransport uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com.colourswift.cssecurity.vpn.backend_port.health.TunnelWatchdog uses a type in com.colourswift.cssecurity.vpn.backend_port.core.
com.colourswift.cssecurity.vpn.backend_port.health.TunnelWatchdog uses com.colourswift.cssecurity.vpn.backend_port.core, so a change to com.colourswift.cssecurity.vpn.backend_port.core can break com.colourswift.cssecurity.vpn.backend_port.health.TunnelWatchdog, while a change to com.colourswift.cssecurity.vpn.backend_port.health.TunnelWatchdog can't break com.colourswift.cssecurity.vpn.backend_port.core.
Position
Below the diagonal: com.colourswift.cssecurity.vpn.backend_port.health.TunnelWatchdog uses a module listed above it, which is the healthy direction.
com.colourswift.cssecurity.CSForegroundService uses com.colourswift.cssecurity, so a change to com.colourswift.cssecurity can break com.colourswift.cssecurity.CSForegroundService, while a change to com.colourswift.cssecurity.CSForegroundService can't break com.colourswift.cssecurity.
Position
Below the diagonal: com.colourswift.cssecurity.CSForegroundService uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 53.9 · Adequate · gated by X5 ·
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
15
High / Critical
Roadmap
Top priorities: Add a CI workflow that builds and runs the test suite on every push/PR; Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.dart; 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.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.dart.
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.
Put every file in a nullable-enabled context — `#nullable enable` at its top, or commit a project file with <Nullable>enable</Nullable> — and resolve warnings rather than suppressing with `!`.
Dart: await the async dart:io API (readAsString, writeAsString, Process.run, Future.delayed) instead of the *Sync variant or sleep(), or move heavy synchronous work to another isolate with Isolate.run.
Bring the 73 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with SystemWatcher.poll (cyclomatic 55), TermKeyListener.mapControlChar (cyclomatic 55), _ScanScreenState._applyHeadlessEvent (cyclomatic 51).
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 — 7
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 — 763
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 — 68
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 9
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 36 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 36 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, 831 of 838 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.dart) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.dart) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 8 Maven/Gradle manifest(s) were read, stating a version for 10 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Gradle build (build.gradle/build.gradle.kts), but the licence verdict published here was taken over its pub package dependencies. Nothing was read about its Gradle dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-contributor repository — bus factor is not applicable (1 contributor(s) across 205 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so there is nothing here for the owner to act on.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `android/app/build.gradle.kts`, `android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt`, `android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/bridge/alpinstaller.kt` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: a native UI project (pubspec.yaml). The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository's C# was parsed (it ships no .sln or .csproj, so it was read as syntax-only projects), but this check proves its findings from resolved symbols and a reference-free parse resolves none. It abstained rather than report a clean bill it could not earn. That is a gap in this analyzer's reach into build-less repositories — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
73 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was SystemWatcher.poll at 55. A further 3 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 FullVpnController.statusText at 26 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: REDACTED (AvHomeScreenState._handleDrawerItem at 16). 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.
+ 61 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 73 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with SystemWatcher.poll (cyclomatic 55), TermKeyListener.mapControlChar (cyclomatic 55), _ScanScreenState._applyHeadlessEvent (cyclomatic 51). — 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 73 together lifts Cyclomatic Complexity from 6.3 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
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.
+ 103 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 9 bodies over 60 down to 60 or less in Cognitive Complexity — start with SystemWatcher.poll (cognitive 91), _ScanScreenState._applyHeadlessEvent (cognitive 85), _ScanScreenState._applyHeadlessEvent (cognitive 85). — 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 9 together lifts Cognitive Complexity from 4.2 to about 5.1/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.7 / 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 44 MethodTooLong finding(s) in God Classes — start with scan_screen.dart (8), REDACTED (4), cleaner_lite_screen.dart (3). — One of this dimension's main actionable groups (44 warning-level).
Resolve the 30 FileTooLong finding(s) in God Classes — start with scan_screen.dart (3), REDACTED (2), NetworkProtectionScreen.dart (2). — One of this dimension's main actionable groups (30 warning-level).
Resolve the 27 ClassTooLong finding(s) in God Classes — start with scan_screen.dart (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (27 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
315 duplicated block group(s) detected. 8.6 % of the production lines (14,284 of 165,774) are in a reported copy. A further 106 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 179 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 16 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with scan_screen.dart (4), REDACTED (4), terminal_controller.dart (3). — One of this dimension's main actionable groups (16 warning-level).
Resolve the 16 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with REDACTED (4), scan_screen.dart (3), CSForegroundService.kt (2). — One of this dimension's main actionable groups (16 warning-level).
Resolve the 16 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with REDACTED (4), scan_screen.dart (4), REDACTED (2). — One of this dimension's main actionable groups (16 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling7.3 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
6 production modules (Gradle+pub+CMake), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 2 module(s) off the main sequence, with abstractness counted on 5 of the 6 (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).
Off the main sequence: usage_stats (pub) · ×2
What to do
Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 8 Low cohesion finding(s) in Cohesion (LCOM4) — start with scan_screen.dart (3), antivirus_bridge.dart, scan_ui_screen.dart. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 163 resolved pub package(s) use a banned license. Licences were read from pub.dev's analysis of each package's licence file, over every package this repository's pubspec.lock resolves from pub.dev, direct and transitive, at the locked version; the 2 package(s) the lock marks direct dev are excluded, and SDK, path and git packages have no registry release to read. pub.dev analyses only recent releases, so for 57 package(s) locked at an older version the licence read is that of the package's latest analysed release, not of the locked one. 3 of them carry no licence pub.dev recognises; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's pub package dependencies and nothing else. The repository also declares a Gradle build (build.gradle/build.gradle.kts), and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 10 Hotspot finding(s) in Churn × Complexity Hotspots — start with scan_screen.dart, REDACTED, detail_screen.dart. — One of this dimension's main actionable groups (10 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.
8 deducted task-comment markers across 165774 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 5 XxxComment finding(s) in Explicit Debt — start with TranscriptScreen.java (3), EmulatorView.java, UnicodeTranscript.java. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 3 TodoComment finding(s) in Explicit Debt — start with EmulatorView.java (2), defs_loader.dart. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 2 documentation facets pass in full; short on: F2 example. 6 document(s) read across 7 unit(s).
Documentation: no build, run or usage exampleREADME.md:1
What to do
Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).
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: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.dart. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
15 finding(s): 0 critical, 7 high, 2 medium, 6 low. semgrep hit a parse error in 1 file(s) — `REDACTED` (line 20, line 42, line 51, …) — 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
What to do
Resolve the 7 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (7). — One of this dimension's main actionable groups (7 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
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.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 4 platform declaration(s) and 10 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — Whether any singleton service captures a scoped/transient dependency — a silent lifetime/threading bug.
Method: Roslyn scan: DI registrations parsed from AddSingleton/Scoped/Transient; each singleton checked for captured shorter-lifetime dependencies. Exhaustive, deterministic.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
`AppLocalizations` declares 1218 abstract methods: `appName`, `ok`, `cancel`, `footerHome`, `footerExplore`, `footerRemoved`, `footerSettings`, `proBadge`, `updateDbTitle`, `updateDbVersionLabel`, `companionAppsSectionTitle`, `cleanerReclaimableLabel`, `exploreMultiThreadingTitle`, `exploreMultiThreadingSubtitle`, `updateDbAutoDownloadLabel`, `updateDbUpdatedAutoOn`, `updateDbUpdatedSuccess`, `updateDbUpdateFailed`, `engineReadyBanner`, `scanButton`, `scanModeFullTitle`, `scanModeFullSubtitle`, `scanModeSmartTitle`, `scanModeSmartSubtitle`, `scanModeRapidTitle`, `scanModeRapidSubtitle`, `scanModeInstalledTitle`, `scanModeInstalledSubtitle`, `scanModeSingleTitle`, `scanModeSingleSubtitle`, `scanModeCustomTitle`, `scanModeCustomSubtitle`, `customScanChooseSubtitle`, `customChoiceFolder`, `customChoiceFolderSubtitle`, `customChoiceSdCard`, `customChoiceSdCardSubtitle`, `customChoiceFileSubtitle`, `customChoiceExclusionsSubtitle`, `useCloudAssistedScan`, and 1178 more. Counted over its public methods with no body, once per name; concrete methods and `_`-private members are not counted, because no implementer that extends it is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — lib/translations/app_localizations.dart:18
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Do you agree with this assessment?
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
What to do
Add a CI workflow that builds and runs the test suite on every push/PR.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
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 `semgrep --config=auto` plus gitleaks for committed secrets — this tree has no MSBuild project file, so CodeQL's csharp pack (which traces a build) and NuGet security analyzers (which are referenced from a project) have nothing to attach to — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
`android/app/build.gradle.kts` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — android/app/build.gradle.kts:97
What to do
Run what this repository's stack ships: `semgrep --config=auto` plus gitleaks for committed secrets — this tree has no MSBuild project file, so CodeQL's csharp pack (which traces a build) and NuGet security analyzers (which are referenced from a project) have nothing to attach to — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`_startScan` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/foundation.dart:35
`clearAll` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/services/cache_manager.dart:5
What to do
Dart: await the async dart:io API (readAsString, writeAsString, Process.run, Future.delayed) instead of the *Sync variant or sleep(), or move heavy synchronous work to another isolate with Isolate.run.
Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
0/1 C# file(s) are in a nullable-enabled context. This repository commits no project file, so nothing sets <Nullable>enable</Nullable> for it: a file is enabled only by its own `#nullable enable`, by a Unity `csc.rsp` with `-nullable:enable` for its assembly, or as a file-based app (`#:` directives) whose `#:property Nullable` does not turn it off. NRTs catch a whole class of null-deref bugs at compile time.
What to do
Put every file in a nullable-enabled context — `#nullable enable` at its top, or commit a project file with <Nullable>enable</Nullable> — and resolve warnings rather than suppressing with `!`.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 34 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 20 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 78 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.
AX2 Stateful singletons — no singleton implementations detected
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
D10 Test Quality — ~38 lines of test source are present (.dart) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — no .dart test runner
D12 Dependency Hygiene — Not scored — 8 Maven/Gradle manifest(s) were read, stating a version for 10 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
D16 Bus Factor — single-contributor repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 6 candidate(s) found and not reported.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .dart, .java, .kt, .rs, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D27 Navigability — Most of this repository's production source (.c, .cs, .java, .kt, .m, .rs, .swift) was not read by navigability analysis, so tracing effort was not assessed — whatever else resolved (another language's projects) is not this repository's navigability. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 3 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
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
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (28 value object(s))
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, which this analysis does not build from source alone for this language. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable (this repository commits no MSBuild project, so its C# was read as syntax-only projects — a handler marked ONLY by an interface from a package is not visible without a build)
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
IC1 Incompleteness & stubs — reported, not scored — this repository's C# declares no analysable method bodies (a constants, record or DTO assembly), and this score is a density of unfinished work per method, which has no denominator here. The file-level signals below were still collected and are shown in full
M4 Documentation accuracy — Not applicable: the 6 current-state document(s) make no claim of a kind M4 checks. 7 claim(s) of kinds M4 does not check were not checked (path 4, environment variable 3); M4 checks only links and versions and artefact counts.
P12 CI test-gate honesty — no CI workflow found
P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X12 Unreachable branch — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — no async method does work a token could cancel
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — This check needs a compiled C# program and this repository commits no project file to compile, so only its syntax could be read. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X3 Exception handling — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X4 Structured logging — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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: SettingsScreenState.build REDACTED:955— MethodTooLong — build 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: _ScheduledScansScreenState.build lib/screens/scan/scheduled_scan_screen.dart:196— MethodTooLong — build runs 281 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 181 over it, 2.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MainActivity.configureFlutterEngine android/app/src/main/kotlin/com/colourswift/cssecurity/MainActivity.kt:296— MethodTooLong — configureFlutterEngine runs 234 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 134 over it, 2.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: _CleanerDetailScreenState.build lib/screens/scan/detail_screen.dart:200— MethodTooLong — build runs 224 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _FullVpnModeScreenState._connectionScreen lib/screens/vpn/full_vpn_mode_screen.dart:457— MethodTooLong — _connectionScreen runs 224 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EmulatorView.onCreateInputConnection android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:649— MethodTooLong — onCreateInputConnection runs 220 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 120 over it, 2.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: SystemWatcher.poll android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcher.kt:275— MethodTooLong — poll runs 214 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 114 over it, 2.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _ScanScreenState._buildResultThreats lib/screens/home/scan_screen.dart:1909— MethodTooLong — _buildResultThreats runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _ScanScreenState._buildResultThreats lib/screens/scan/main_scan_ui/scan_screen.dart:1874— MethodTooLong — _buildResultThreats runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _ProScreenState.build lib/screens/pro/pro_screen.dart:497— MethodTooLong — build runs 201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 101 over it, 2.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: _CleanerLitePaneState.build lib/screens/scan/cleaner_lite_screen.dart:311— MethodTooLong — build runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× 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: AvHomeDrawer.build lib/screens/home/av_home_drawer.dart:16— MethodTooLong — build runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.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: _FullVpnSettingsScreenState._usageAndServerPanel lib/screens/settings/full_vpn_settings_screen.dart:317— MethodTooLong — _usageAndServerPanel runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× 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: DeviceSecuritySignalLoader.loadSignals lib/screens/home/device_security_screen.dart:435— MethodTooLong — loadSignals runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.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: _NetworkAdvancedScreenState._blocklistsTab lib/screens/vpn/NetworkProtectionScreen.dart:579— MethodTooLong — _blocklistsTab runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _NetworkAdvancedScreenState._blocklistsTab lib/screens/vpn/dns/NetworkProtectionScreen.dart:559— MethodTooLong — _blocklistsTab runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TerminalEmulator.doEscLeftSquareBracket android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:1173— MethodTooLong — doEscLeftSquareBracket runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.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: _QuarantineScreenState.build lib/screens/quarantine/quarantine_screen.dart:192— MethodTooLong — build runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _ScanScreenState._buildScanningMain lib/screens/home/scan_screen.dart:1569— MethodTooLong — _buildScanningMain runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: _ScanScreenState._buildScanningMain lib/screens/scan/main_scan_ui/scan_screen.dart:1534— MethodTooLong — _buildScanningMain runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: _ScanScreenState._buildResult lib/screens/scan_ui_screen.dart:1563— MethodTooLong — _buildResult runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TerminalController._buildCommands lib/terminal/terminal_controller.dart:160— MethodTooLong — _buildCommands runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _CleanerLitePaneState._runCleaner lib/screens/scan/cleaner_lite_screen.dart:58— MethodTooLong — _runCleaner runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FullVpnController._connectInternal REDACTED:549— MethodTooLong — _connectInternal runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× 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: _LinkCheckScreenState._analyseTab lib/screens/link checker/link_check_screen.dart:455— MethodTooLong — _analyseTab runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: home/scan_screen.dart lib/screens/home/scan_screen.dart— FileTooLong — 1750 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: _ScanScreenState (71-2384). The bar is 500 significant lines; this is 1250 over it, 3.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: main_scan_ui/scan_screen.dart lib/screens/scan/main_scan_ui/scan_screen.dart— FileTooLong — 1726 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: _ScanScreenState (116-2349). The bar is 500 significant lines; this is 1226 over it, 3.45× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: screens/scan_ui_screen.dart lib/screens/scan_ui_screen.dart— FileTooLong — 1583 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: _ScanScreenState (296-1929). The bar is 500 significant lines; this is 1083 over it, 3.17× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1189 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: AvHomeScreenState (61-1480). The bar is 500 significant lines; this is 689 over it, 2.38× 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: emulator/TerminalEmulator.java android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java— FileTooLong — 1167 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: TerminalEmulator (42-2017). The bar is 500 significant lines; this is 667 over it, 2.33× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1113 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: SettingsScreenState (44-1388). The bar is 500 significant lines; this is 613 over it, 2.23× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: screens/scan_screen.dart lib/screens/scan_screen.dart— FileTooLong — 991 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 491 over it, 1.98× 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: vpn/NetworkProtectionScreen.dart lib/screens/vpn/NetworkProtectionScreen.dart— FileTooLong — 980 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: _NetworkAdvancedScreenState (75-1253). The bar is 500 significant lines; this is 480 over it, 1.96× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 956 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: _AvHomeScreenState (42-1346). The bar is 500 significant lines; this is 456 over it, 1.91× 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: view/EmulatorView.java android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java— FileTooLong — 939 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: EmulatorView (77-1760). The bar is 500 significant lines; this is 439 over it, 1.88× 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: dns/NetworkProtectionScreen.dart lib/screens/vpn/dns/NetworkProtectionScreen.dart— FileTooLong — 932 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: _NetworkAdvancedScreenState (25-1310). The bar is 500 significant lines; this is 432 over it, 1.86× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 928 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: FullVpnController (18-1309). The bar is 500 significant lines; this is 428 over it, 1.86× 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: scan api/headless_scan.dart lib/services/scan api/headless_scan.dart— FileTooLong — 818 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 318 over it, 1.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: vpn/AdvancedNetworkProtection_screen.dart lib/screens/vpn/AdvancedNetworkProtection_screen.dart— FileTooLong — 753 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: _NetworkAdvancedScreenState (71-936). The bar is 500 significant lines; this is 253 over it, 1.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: scan/cleaner_lite_screen.dart lib/screens/scan/cleaner_lite_screen.dart— FileTooLong — 749 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: _CleanerLitePaneState (35-685). The bar is 500 significant lines; this is 249 over it, 1.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: services/realtime_protection_service.dart lib/services/realtime_protection_service.dart— FileTooLong — 710 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: RealtimeProtectionService (36-903). The bar is 500 significant lines; this is 210 over it, 1.42× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: vpn/full_vpn_mode_screen.dart lib/screens/vpn/full_vpn_mode_screen.dart— FileTooLong — 695 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: _FullVpnModeScreenState (20-913). The bar is 500 significant lines; this is 195 over it, 1.39× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED lib/screens/vpn/services/full_vpn_backend.dart— FileTooLong — 689 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: FullVpnController (16-947). The bar is 500 significant lines; this is 189 over it, 1.38× 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: apkAnalyser/apk_analyser.dart lib/screens/apkAnalyser/apk_analyser.dart— FileTooLong — 673 significant lines (blank, comment-only and punctuation-only lines excluded), about 70% of them inside a single declaration: _ApkAnalyserScreenState (20-696). The bar is 500 significant lines; this is 173 over it, 1.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: link checker/link_check_screen.dart lib/screens/link checker/link_check_screen.dart— FileTooLong — 669 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: _LinkCheckScreenState (21-939). The bar is 500 significant lines; this is 169 over it, 1.34× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: home/device_security_screen.dart lib/screens/home/device_security_screen.dart— FileTooLong — 633 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 133 over it, 1.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 633 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: _PasswordManagerScreenState (22-908). The bar is 500 significant lines; this is 133 over it, 1.27× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: cssecurity/MainActivity.kt android/app/src/main/kotlin/com/colourswift/cssecurity/MainActivity.kt— FileTooLong — 629 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: MainActivity (202-899). The bar is 500 significant lines; this is 129 over it, 1.26× 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: rtp/SystemWatcher.kt android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcher.kt— FileTooLong — 626 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: SystemWatcher (25-882). The bar is 500 significant lines; this is 126 over it, 1.25× 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: core/VpnConnectionController.kt android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/backend_port/core/VpnConnectionController.kt— FileTooLong — 572 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 72 over it, 1.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
ClassTooLong: _ScanScreenState lib/screens/home/scan_screen.dart:71— ClassTooLong — 1690 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 400 significant lines; this is 1290 over it, 4.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _ScanScreenState lib/screens/scan/main_scan_ui/scan_screen.dart:116— ClassTooLong — 1630 significant lines (blank, comment-only and punctuation-only lines excluded), 67 methods. The bar is 400 significant lines; this is 1230 over it, 4.08× 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: _ScanScreenState lib/screens/scan_ui_screen.dart:296— ClassTooLong — 1195 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 795 over it, 2.99× 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: TerminalEmulator android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:42— ClassTooLong — 1152 significant lines (blank, comment-only and punctuation-only lines excluded), 84 methods. The bar is 400 significant lines; this is 752 over it, 2.88× 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: AvHomeScreenState REDACTED:61— ClassTooLong — 988 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 588 over it, 2.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SettingsScreenState REDACTED:44— ClassTooLong — 966 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 566 over it, 2.42× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FullVpnController REDACTED:18— ClassTooLong — 914 significant lines (blank, comment-only and punctuation-only lines excluded), 74 methods. The bar is 400 significant lines; this is 514 over it, 2.29× 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: _NetworkAdvancedScreenState lib/screens/vpn/dns/NetworkProtectionScreen.dart:25— ClassTooLong — 912 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 512 over it, 2.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _AvHomeScreenState REDACTED:42— ClassTooLong — 899 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 499 over it, 2.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: EmulatorView android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:77— ClassTooLong — 894 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods. The bar is 400 significant lines; this is 494 over it, 2.24× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _NetworkAdvancedScreenState lib/screens/vpn/NetworkProtectionScreen.dart:75— ClassTooLong — 834 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 434 over it, 2.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FullVpnController lib/screens/vpn/services/full_vpn_backend.dart:16— ClassTooLong — 675 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 275 over it, 1.69× 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: _LinkCheckScreenState lib/screens/link checker/link_check_screen.dart:21— ClassTooLong — 645 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 245 over it, 1.61× 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: _FullVpnModeScreenState lib/screens/vpn/full_vpn_mode_screen.dart:20— ClassTooLong — 639 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 239 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RealtimeProtectionService lib/services/realtime_protection_service.dart:36— ClassTooLong — 617 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 217 over it, 1.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _PasswordManagerScreenState REDACTED:22— ClassTooLong — 616 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 216 over it, 1.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _NetworkAdvancedScreenState lib/screens/vpn/AdvancedNetworkProtection_screen.dart:71— ClassTooLong — 613 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 213 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SystemWatcher android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcher.kt:25— ClassTooLong — 600 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 200 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.
ClassTooLong: _ProScreenState lib/screens/pro/pro_screen.dart:16— ClassTooLong — 539 significant lines (blank, comment-only and punctuation-only lines excluded), 16 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: _FullVpnSettingsScreenState lib/screens/settings/full_vpn_settings_screen.dart:17— ClassTooLong — 535 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 135 over it, 1.34× 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: CSForegroundService android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:33— ClassTooLong — 508 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 108 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _CleanerLitePaneState lib/screens/scan/cleaner_lite_screen.dart:35— ClassTooLong — 489 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 89 over it, 1.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: TermKeyListener android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:21— ClassTooLong — 487 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 87 over it, 1.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: MainActivity android/app/src/main/kotlin/com/colourswift/cssecurity/MainActivity.kt:202— ClassTooLong — 480 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 80 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.
ClassTooLong: _ApkAnalyserScreenState lib/screens/apkAnalyser/apk_analyser.dart:20— ClassTooLong — 472 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 72 over it, 1.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TerminalEmulator android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:42— TooManyMethods — 84 methods. The bar is 30 methods; this is 54 over it, 2.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FullVpnController REDACTED:18— TooManyMethods — 74 methods. The bar is 30 methods; this is 44 over it, 2.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: _ScanScreenState lib/screens/home/scan_screen.dart:71— 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: EmulatorView android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:77— TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: _ScanScreenState lib/screens/scan/main_scan_ui/scan_screen.dart:116— TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FullVpnController lib/screens/vpn/services/full_vpn_backend.dart:16— 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: _ScanScreenState lib/screens/scan_ui_screen.dart:296— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AvHomeScreenState REDACTED:61— TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LiteVpnController lib/screens/vpn/lite_vpn_controller.dart:46— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SettingsScreenState REDACTED:44— 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: VpnConnectionController android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/backend_port/core/VpnConnectionController.kt:25— 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: _AvHomeScreenState REDACTED:42— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: _NetworkAdvancedScreenState lib/screens/vpn/dns/NetworkProtectionScreen.dart:25— 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: TermSession android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TermSession.java:63— 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: _NetworkAdvancedScreenState lib/screens/vpn/NetworkProtectionScreen.dart:75— 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.
TooManyMethods: UnicodeTranscript android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:48— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: _ScanScreenState lib/screens/scan_screen.dart:180— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (11 lines × 2) lib/screens/home/scan_screen.dart:704— lib/screens/home/scan_screen.dart:704-714 | lib/screens/scan/main_scan_ui/scan_screen.dart:748-758 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) lib/screens/home/scan_screen.dart:1130— lib/screens/home/scan_screen.dart:1130-1140 | lib/screens/scan/main_scan_ui/scan_screen.dart:1095-1105 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) lib/screens/home/scan_screen.dart:1142— lib/screens/home/scan_screen.dart:1142-1152 | lib/screens/scan/main_scan_ui/scan_screen.dart:1107-1117 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) lib/screens/link checker/link_check_screen.dart:661— lib/screens/link checker/link_check_screen.dart:661-671 | lib/screens/link checker/webview_screen.dart:163-173 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/link checker/link_check_screen.dart:661` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) lib/screens/link checker/link_check_screen.dart:905— lib/screens/link checker/link_check_screen.dart:905-915 | lib/screens/scan/cleaner_screen.dart:35-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/link checker/link_check_screen.dart:905` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) lib/screens/scan/cleaner_app_manager_screen.dart:360— lib/screens/scan/cleaner_app_manager_screen.dart:360-370 | lib/screens/scan/detail_screen.dart:430-440 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/cleaner_app_manager_screen.dart:360` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) lib/screens/settings/full_vpn_settings_screen.dart:56— lib/screens/settings/full_vpn_settings_screen.dart:56-66 | lib/screens/vpn/full_vpn_mode_screen.dart:188-198 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/full_vpn_settings_screen.dart:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/settings/full_vpn_settings_screen.dart:54` calls `of` and `lib/screens/vpn/full_vpn_mode_screen.dart:186` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) lib/screens/settings/full_vpn_settings_screen.dart:620— lib/screens/settings/full_vpn_settings_screen.dart:620-630 | lib/screens/settings/full_vpn_settings_screen.dart:661-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 `lib/screens/settings/full_vpn_settings_screen.dart:620` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:615— lib/screens/vpn/services/full_vpn_backend.dart:615-625 | REDACTED:826-836 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:833— lib/screens/vpn/services/full_vpn_backend.dart:833-843 | REDACTED:1164-1174 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:924— lib/screens/vpn/services/full_vpn_backend.dart:924-934 | REDACTED:1286-1296 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/services/full_vpn_backend.dart:924` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact 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 × 2) lib/terminal/terminal_controller.dart:240— lib/terminal/terminal_controller.dart:240-250 | lib/terminal/terminal_controller.dart:278-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/terminal/terminal_controller.dart:240` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) lib/terminal/terminal_controller.dart:420— lib/terminal/terminal_controller.dart:420-430 | lib/terminal/terminal_controller.dart:447-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/terminal/terminal_controller.dart:420` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) lib/terminal/terminal_controller.dart:434— lib/terminal/terminal_controller.dart:434-444 | lib/terminal/terminal_controller.dart:517-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/terminal/terminal_controller.dart:434` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) lib/screens/home/scan_screen.dart:548— lib/screens/home/scan_screen.dart:548-558 | lib/screens/scan/main_scan_ui/scan_screen.dart:592-602 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:936— lib/screens/vpn/services/full_vpn_backend.dart:936-946 | REDACTED:1298-1308 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) lib/foundation.dart:133— lib/foundation.dart:133-140 | lib/foundation.dart:242-248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/foundation.dart:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) lib/screens/scan/cleaner_app_manager_screen.dart:157— lib/screens/scan/cleaner_app_manager_screen.dart:157-163 | lib/screens/scan/cleaner_pro_screen.dart:90-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/cleaner_app_manager_screen.dart:157` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) lib/screens/scan_screen.dart:1027— lib/screens/scan_screen.dart:1027-1033 | lib/screens/scan_screen.dart:1125-1131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:818— lib/screens/vpn/services/full_vpn_backend.dart:818-824 | REDACTED:1149-1155 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) lib/services/realtime_protection_service.dart:726— lib/services/realtime_protection_service.dart:726-732 | lib/services/realtime_protection_service.dart:783-789 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/realtime_protection_service.dart:726` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) lib/screens/home/scan_screen.dart:175— lib/screens/home/scan_screen.dart:175-181 | lib/screens/scan/main_scan_ui/scan_screen.dart:219-225 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) lib/screens/home/scan_screen.dart:1425— lib/screens/home/scan_screen.dart:1425-1431 | lib/screens/scan/main_scan_ui/scan_screen.dart:1390-1396 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:22— lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:22-28 | lib/screens/scan_ui_screen.dart:1944-1950 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:188— lib/screens/vpn/services/full_vpn_backend.dart:188-194 | REDACTED:254-260 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:680— lib/screens/vpn/services/full_vpn_backend.dart:680-686 | REDACTED:891-897 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:722— lib/screens/vpn/services/full_vpn_backend.dart:722-728 | REDACTED:1046-1052 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) lib/screens/vpn/services/full_vpn_location_map.dart:63— lib/screens/vpn/services/full_vpn_location_map.dart:63-69 | lib/vpn/services/full_vpn_location_map.dart:107-113 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_location_map.dart` and `lib/vpn/services/full_vpn_location_map.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:41— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:41-47 | lib/screens/vpn/NetworkProtectionScreen.dart:45-51 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot 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) android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:390— android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:390-396 | android/app/src/main/kotlin/com/colourswift/cssecurity/MainActivity.kt:316-322 — 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 `android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:390` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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, `android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:397` calls `get` and `android/app/src/main/kotlin/com/colourswift/cssecurity/MainActivity.kt:323` 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) android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:363— android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:363-369 | android/app/src/main/kotlin/com/colourswift/cssecurity/MainActivity.kt:301-307 — 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 `android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:363` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:444— android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:444-450 | android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:472-478 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:444` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) REDACTED:173— REDACTED:173-178 | REDACTED:71-76 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) REDACTED:185— REDACTED:185-190 | REDACTED:83-88 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) REDACTED:262— REDACTED:262-267 | REDACTED:96-101 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) REDACTED:269— REDACTED:269-274 | REDACTED:103-108 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:15— lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:15-20 | lib/screens/scan_ui_screen.dart:102-107 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) lib/screens/scan_screen.dart:74— lib/screens/scan_screen.dart:74-79 | lib/services/scan_controller.dart:71-76 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/services/scan_controller.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) lib/screens/scan_screen.dart:218— lib/screens/scan_screen.dart:218-223 | lib/screens/scan_ui_screen.dart:388-393 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) lib/screens/scan_screen.dart:1397— lib/screens/scan_screen.dart:1397-1402 | lib/services/scan_controller.dart:402-407 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/services/scan_controller.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:739— lib/screens/vpn/services/full_vpn_backend.dart:739-744 | REDACTED:1063-1068 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:826— lib/screens/vpn/services/full_vpn_backend.dart:826-831 | REDACTED:1157-1162 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) lib/screens/vpn/services/full_vpn_location_map.dart:84— lib/screens/vpn/services/full_vpn_location_map.dart:84-89 | lib/vpn/services/full_vpn_location_map.dart:156-161 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_location_map.dart` and `lib/vpn/services/full_vpn_location_map.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) lib/screens/features_screen.dart:33— lib/screens/features_screen.dart:33-38 | REDACTED:739-744 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/features_screen.dart:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) lib/screens/scan_screen.dart:27— lib/screens/scan_screen.dart:27-32 | lib/services/scan_controller.dart:31-36 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/services/scan_controller.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_screen.dart:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/services/scan_controller.dart:37` calls `call` and `lib/screens/scan_screen.dart:33` 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) plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/UsageStats.kt:60— plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/UsageStats.kt:60-65 | plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/UsageStats.kt:81-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/UsageStats.kt:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/UsageStats.kt:68` calls `toString` and `plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/UsageStats.kt:89` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:437— android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:437-442 | android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:471-476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:437` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) android/app/src/main/jniLibs/trimmed_Engine.rs:567— android/app/src/main/jniLibs/trimmed_Engine.rs:567-572 | android/app/src/main/jniLibs/trimmed_Engine.rs:759-764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/app/src/main/jniLibs/trimmed_Engine.rs:567` it does not close everything it opens, so those exact lines 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) REDACTED:896— REDACTED:896-907 | REDACTED:266-277 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:896` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) lib/screens/home/scan_screen.dart:645— lib/screens/home/scan_screen.dart:645-656 | lib/screens/scan/main_scan_ui/scan_screen.dart:689-700 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:645` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) lib/screens/home/scan_screen.dart:1154— lib/screens/home/scan_screen.dart:1154-1165 | lib/screens/scan/main_scan_ui/scan_screen.dart:1119-1130 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) lib/screens/link checker/link_check_screen.dart:558— lib/screens/link checker/link_check_screen.dart:558-569 | lib/screens/link checker/link_check_screen.dart:830-841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/link checker/link_check_screen.dart:558` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:79— lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:79-90 | lib/screens/scan_ui_screen.dart:2001-2012 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:79` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:119— lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:119-130 | lib/screens/scan_ui_screen.dart:2041-2052 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:119` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:79— lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:79-90 | lib/screens/scan_ui_screen.dart:164-175 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:79` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) lib/screens/scan_screen.dart:81— lib/screens/scan_screen.dart:81-92 | lib/services/scan_controller.dart:78-89 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/services/scan_controller.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) lib/screens/scan_screen.dart:530— lib/screens/scan_screen.dart:530-541 | lib/screens/scan_screen.dart:546-557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_screen.dart:530` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) lib/screens/scan_ui_screen.dart:1067— lib/screens/scan_ui_screen.dart:1067-1078 | lib/screens/scan_ui_screen.dart:1081-1092 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_ui_screen.dart:1067` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:237— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:237-248 | lib/screens/vpn/AdvancedNetworkProtection_screen.dart:355-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:352` calls `_saveCloudPrefs`, `getInstance` and `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:235` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:771— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:771-782 | lib/screens/vpn/NetworkProtectionScreen.dart:910-921 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:255— lib/screens/vpn/services/full_vpn_backend.dart:255-266 | REDACTED:345-356 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/services/full_vpn_backend.dart:255` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot 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) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:525— android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:525-536 | android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:571-582 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:525` it does not close everything it opens, so those exact lines 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) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:385— android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:385-396 | android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:401-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:385` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) lib/screens/home/av_home_feature_row.dart:21— lib/screens/home/av_home_feature_row.dart:21-33 | lib/screens/home/av_home_primary_control.dart:28-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/av_home_feature_row.dart:21` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) REDACTED:207— REDACTED:207-219 | lib/services/realtime_protection_service.dart:126-138 — 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 (13 lines × 2) REDACTED:1738— REDACTED:1738-1750 | lib/screens/home/security_report_screen.dart:549-561 — 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 (13 lines × 2) lib/screens/home/scan_screen.dart:183— lib/screens/home/scan_screen.dart:183-195 | lib/screens/scan/main_scan_ui/scan_screen.dart:227-239 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) lib/screens/home/scan_screen.dart:532— lib/screens/home/scan_screen.dart:532-544 | lib/screens/scan/main_scan_ui/scan_screen.dart:576-588 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) lib/screens/home/scan_screen.dart:626— lib/screens/home/scan_screen.dart:626-638 | lib/screens/scan/main_scan_ui/scan_screen.dart:670-682 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) REDACTED:1099— REDACTED:1099-1111 | lib/screens/link checker/link_check_screen.dart:712-724 — 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 `REDACTED:1099` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) lib/screens/pro/pro_screen.dart:208— lib/screens/pro/pro_screen.dart:208-220 | lib/screens/pro/pro_screen.dart:402-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.
Duplicated block (13 lines × 2) lib/screens/pro/pro_screen.dart:264— lib/screens/pro/pro_screen.dart:264-276 | lib/screens/pro/pro_screen.dart:436-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/pro/pro_screen.dart: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 (13 lines × 2) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:251— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:251-263 | lib/screens/vpn/NetworkProtectionScreen.dart:379-391 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:251` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:286— lib/screens/vpn/NetworkProtectionScreen.dart:286-298 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:266-278 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/NetworkProtectionScreen.dart:286` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) lib/services/realtime_protection_service.dart:822— lib/services/realtime_protection_service.dart:822-834 | lib/services/realtime_protection_service.dart:856-868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/realtime_protection_service.dart:822` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) android/app/src/main/kotlin/com/colourswift/cssecurity/ShizukuBridge.kt:204— android/app/src/main/kotlin/com/colourswift/cssecurity/ShizukuBridge.kt:204-216 | android/app/src/main/kotlin/com/colourswift/cssecurity/ShizukuBridge.kt:225-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/app/src/main/kotlin/com/colourswift/cssecurity/ShizukuBridge.kt:204` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) lib/screens/apkAnalyser/apk_analyser.dart:369— lib/screens/apkAnalyser/apk_analyser.dart:369-385 | REDACTED:894-910 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/apkAnalyser/apk_analyser.dart:369` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) lib/screens/home/ring_pulse.dart:12— lib/screens/home/ring_pulse.dart:12-28 | REDACTED:1357-1373 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) lib/screens/home/scan_screen.dart:679— lib/screens/home/scan_screen.dart:679-695 | lib/screens/scan/main_scan_ui/scan_screen.dart:723-739 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) lib/screens/home/scan_screen.dart:745— lib/screens/home/scan_screen.dart:745-761 | lib/screens/scan/main_scan_ui/scan_screen.dart:789-805 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (17 lines × 2) lib/screens/scan/scheduled_scan_screen.dart:287— lib/screens/scan/scheduled_scan_screen.dart:287-303 | lib/screens/scan/scheduled_scan_screen.dart:325-341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/scheduled_scan_screen.dart:287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:355— lib/screens/vpn/NetworkProtectionScreen.dart:355-371 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:335-351 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/NetworkProtectionScreen.dart:355` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:514— lib/screens/vpn/services/full_vpn_backend.dart:514-530 | REDACTED:722-738 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/services/full_vpn_backend.dart:514` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) lib/screens/vpn/services/full_vpn_location_service.dart:19— lib/screens/vpn/services/full_vpn_location_service.dart:19-35 | lib/vpn/services/full_vpn_location_service.dart:21-37 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_location_service.dart` and `lib/vpn/services/full_vpn_location_service.dart` 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (17 lines × 2) lib/screens/vpn/services/full_vpn_location_service.dart:43— lib/screens/vpn/services/full_vpn_location_service.dart:43-59 | lib/vpn/services/full_vpn_location_service.dart:45-61 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_location_service.dart` and `lib/vpn/services/full_vpn_location_service.dart` 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) lib/services/purchase_service.dart:116— lib/services/purchase_service.dart:116-132 | lib/services/purchase_service.dart:198-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) lib/services/realtime_protection_service.dart:644— lib/services/realtime_protection_service.dart:644-660 | lib/services/realtime_protection_service.dart:740-756 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/realtime_protection_service.dart:644` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:818— android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:818-834 | android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:912-928 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) lib/screens/scan/detail_screen.dart:378— lib/screens/scan/detail_screen.dart:378-385 | lib/screens/scan/detail_screen.dart:402-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/detail_screen.dart:378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) lib/screens/scan/main_scan_ui/log_buffer.dart:13— lib/screens/scan/main_scan_ui/log_buffer.dart:13-20 | lib/screens/scan_ui_screen.dart:34-41 — before extracting anything, compare `lib/screens/scan/main_scan_ui/log_buffer.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/main_scan_ui/log_buffer.dart:13` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) lib/screens/vpn/full_vpn_mode_screen.dart:464— lib/screens/vpn/full_vpn_mode_screen.dart:464-471 | lib/screens/vpn/full_vpn_mode_screen.dart:859-866 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/vpn/full_vpn_mode_screen.dart:463` calls `toString` and `lib/screens/vpn/full_vpn_mode_screen.dart:858` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) REDACTED:70— REDACTED:70-77 | REDACTED: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. 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 (8 lines × 2) REDACTED:1752— REDACTED:1752-1759 | lib/screens/home/security_report_screen.dart:597-604 — 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:1752` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) lib/screens/scan/main_scan_ui/log_buffer.dart:24— lib/screens/scan/main_scan_ui/log_buffer.dart:24-31 | lib/screens/scan_ui_screen.dart:45-52 — before extracting anything, compare `lib/screens/scan/main_scan_ui/log_buffer.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:204— lib/screens/vpn/NetworkProtectionScreen.dart:204-211 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:167-174 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:179— lib/screens/vpn/services/full_vpn_backend.dart:179-186 | REDACTED:245-252 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:730— lib/screens/vpn/services/full_vpn_backend.dart:730-737 | REDACTED:1054-1061 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) lib/screens/vpn/services/full_vpn_location_map.dart:132— lib/screens/vpn/services/full_vpn_location_map.dart:132-139 | lib/vpn/services/full_vpn_location_map.dart:212-219 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_location_map.dart` and `lib/vpn/services/full_vpn_location_map.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:171— lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:171-178 | lib/screens/scan_ui_screen.dart:2093-2100 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Hotspot: lib/screens/scan/main_scan_ui/scan_screen.dart lib/screens/scan/main_scan_ui/scan_screen.dart:281— lib/screens/scan/main_scan_ui/scan_screen.dart changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in _ScanScreenState._applyHeadlessEvent at line 281. 2 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 08:44:26 +00:00' --until='2026-11-06 08:44:26 +00:00' --full-history --no-merges -- lib/screens/scan/main_scan_ui/scan_screen.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:955— REDACTED changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in SettingsScreenState.build at line 955. 4 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 08:44:26 +00:00' --until='2026-11-06 08:44:26 +00: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.
Hotspot: lib/screens/scan/detail_screen.dart lib/screens/scan/detail_screen.dart:200— lib/screens/scan/detail_screen.dart changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in _CleanerDetailScreenState.build at line 200. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 08:44:26 +00:00' --until='2026-11-06 08:44:26 +00:00' --full-history --no-merges -- lib/screens/scan/detail_screen.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/services/realtime_protection_service.dart lib/services/realtime_protection_service.dart:642— lib/services/realtime_protection_service.dart changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in RealtimeProtectionService._scanSingleFile at line 642. 2 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 08:44:26 +00:00' --until='2026-11-06 08:44:26 +00:00' --full-history --no-merges -- lib/services/realtime_protection_service.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/screens/scan/scheduled_scan_screen.dart lib/screens/scan/scheduled_scan_screen.dart:196— lib/screens/scan/scheduled_scan_screen.dart changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in _ScheduledScansScreenState.build at line 196. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 08:44:26 +00:00' --until='2026-11-06 08:44:26 +00:00' --full-history --no-merges -- lib/screens/scan/scheduled_scan_screen.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/screens/pro/pro_screen.dart lib/screens/pro/pro_screen.dart:497— lib/screens/pro/pro_screen.dart changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in _ProScreenState.build at line 497. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 08:44:26 +00:00' --until='2026-11-06 08:44:26 +00:00' --full-history --no-merges -- lib/screens/pro/pro_screen.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/screens/apkAnalyser/apk_analyser_controller.dart lib/screens/apkAnalyser/apk_analyser_controller.dart:366— lib/screens/apkAnalyser/apk_analyser_controller.dart changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in ApkAnalyserController.analyseApk at line 366. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 08:44:26 +00:00' --until='2026-11-06 08:44:26 +00:00' --full-history --no-merges -- lib/screens/apkAnalyser/apk_analyser_controller.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/screens/scan/cleaner_app_manager_screen.dart lib/screens/scan/cleaner_app_manager_screen.dart:295— lib/screens/scan/cleaner_app_manager_screen.dart changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in _AppManagerScreenState.build at line 295. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 08:44:26 +00:00' --until='2026-11-06 08:44:26 +00:00' --full-history --no-merges -- lib/screens/scan/cleaner_app_manager_screen.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/services/quarantine_service.dart lib/services/quarantine_service.dart:299— lib/services/quarantine_service.dart changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in QuarantineService.listAll at line 299. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 08:44:26 +00:00' --until='2026-11-06 08:44:26 +00:00' --full-history --no-merges -- lib/services/quarantine_service.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:706— android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in CSForegroundService.startPackageReceiver at line 706. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 08:44:26 +00:00' --until='2026-11-06 08:44:26 +00:00' --full-history --no-merges -- android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.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.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×9
Edited copy of a member (4 corresponding lines) lib/screens/home/scan_screen.dart:2329— lib/screens/home/scan_screen.dart:2329-2332 | lib/screens/scan/main_scan_ui/scan_screen.dart:2294-2297 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) REDACTED:1053— REDACTED:1053-1057 | REDACTED:416-419 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:561— lib/screens/vpn/services/full_vpn_backend.dart:561-564 | REDACTED:773-776 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) REDACTED:180— REDACTED:180-183 | REDACTED:78-81 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) lib/screens/vpn/NetworkProtectionScreen.dart:1141— lib/screens/vpn/NetworkProtectionScreen.dart:1141-1144 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:1135-1138 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) lib/main.dart:42— lib/main.dart:42-47 | lib/services/update_service.dart:36-39 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) lib/screens/scan/main_scan_ui/scan_log_listener.dart:13— lib/screens/scan/main_scan_ui/scan_log_listener.dart:13-16 | lib/widgets/scan_log_listener.dart:14-17 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:795— lib/screens/vpn/services/full_vpn_backend.dart:795-798 | REDACTED:1126-1129 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) lib/services/defs_auto_update_service.dart:14— lib/services/defs_auto_update_service.dart:14-17 | lib/services/scan api/community_submissions/community_submission_service.dart:28-31 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (5 lines × 2) lib/screens/vpn/dns/NetworkProtectionScreen.dart:177— lib/screens/vpn/dns/NetworkProtectionScreen.dart:177-182 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:231-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.
Duplicated block (5 lines × 2) lib/screens/home/scan_screen.dart:1403— lib/screens/home/scan_screen.dart:1403-1407 | lib/screens/scan/main_scan_ui/scan_screen.dart:1368-1372 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) lib/screens/home/scan_screen.dart:1459— lib/screens/home/scan_screen.dart:1459-1463 | lib/screens/scan/main_scan_ui/scan_screen.dart:1424-1428 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) lib/screens/home/scan_screen.dart:1465— lib/screens/home/scan_screen.dart:1465-1469 | lib/screens/scan/main_scan_ui/scan_screen.dart:1430-1434 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) lib/screens/link checker/link_check_screen.dart:165— lib/screens/link checker/link_check_screen.dart:165-169 | lib/screens/link checker/webview_screen.dart:62-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) lib/screens/scan_screen.dart:1430— lib/screens/scan_screen.dart:1430-1434 | lib/services/scan_controller.dart:436-440 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/services/scan_controller.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) lib/utils/worker_hash_isolate.dart:19— lib/utils/worker_hash_isolate.dart:19-23 | lib/utils/worker_scan_isolate.dart:19-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) lib/screens/vpn/services/full_vpn_location_map.dart:143— lib/screens/vpn/services/full_vpn_location_map.dart:143-147 | lib/vpn/services/full_vpn_location_map.dart:266-270 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_location_map.dart` and `lib/vpn/services/full_vpn_location_map.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/vpn/services/full_vpn_location_map.dart:261` calls `_userInteractionBlocked`, `now` and `lib/screens/vpn/services/full_vpn_location_map.dart:142` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Low cohesion: _ScanScreenState (LCOM4 9) lib/screens/home/scan_screen.dart:71— _ScanScreenState's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: _ScanScreenState (LCOM4 9) lib/screens/scan/main_scan_ui/scan_screen.dart:116— _ScanScreenState's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AntivirusBridge (LCOM4 8) lib/widgets/antivirus_bridge.dart:285— AntivirusBridge's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: _ScanScreenState (LCOM4 6) lib/screens/scan_ui_screen.dart:296— _ScanScreenState's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: _ScanScreenState (LCOM4 5) lib/screens/scan_screen.dart:180— _ScanScreenState'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: _AvHomeScreenState (LCOM4 4) REDACTED:42— _AvHomeScreenState'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: Application (LCOM4 4) plugins/device_apps-2.2.0/lib/src/plugin.dart:183— Application'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: _ConsoleScreenState (LCOM4 4) lib/terminal/terminal_screen.dart:31— _ConsoleScreenState'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.
Duplicated block (9 lines × 2) lib/screens/home/av_home_drawer.dart:82— lib/screens/home/av_home_drawer.dart:82-90 | lib/screens/home/av_home_drawer.dart:130-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/av_home_drawer.dart:82` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) lib/screens/scan_ui_screen.dart:358— lib/screens/scan_ui_screen.dart:358-366 | lib/services/realtime_protection_service.dart:529-539 — before extracting anything, compare `lib/screens/scan_ui_screen.dart` and `lib/services/realtime_protection_service.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_ui_screen.dart:358` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:785— lib/screens/vpn/services/full_vpn_backend.dart:785-793 | REDACTED:1116-1124 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:562— lib/screens/vpn/NetworkProtectionScreen.dart:562-570 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:542-550 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) lib/screens/home/scan_screen.dart:1555— lib/screens/home/scan_screen.dart:1555-1563 | lib/screens/scan/main_scan_ui/scan_screen.dart:1520-1528 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:180— lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:180-188 | lib/screens/scan_ui_screen.dart:2102-2110 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:167— lib/screens/vpn/NetworkProtectionScreen.dart:167-175 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:124-132 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×6
Edited copy of a member (7 corresponding lines) lib/screens/scan_screen.dart:27— lib/screens/scan_screen.dart:27-33 | lib/services/scan_controller.dart:31-38 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) lib/screens/home/scan_screen.dart:785— lib/screens/home/scan_screen.dart:785-791 | lib/screens/scan/main_scan_ui/scan_screen.dart:807-813 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) lib/screens/scan/scheduled_scan_screen.dart:66— lib/screens/scan/scheduled_scan_screen.dart:66-72 | REDACTED:310-317 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/VpnModeSwitcher.kt:15— android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/VpnModeSwitcher.kt:15-21 | android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/VpnNotificationActionReceiver.kt:182-188 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:124— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:124-130 | lib/screens/vpn/NetworkProtectionScreen.dart:158-165 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:212— lib/screens/vpn/services/full_vpn_backend.dart:212-218 | REDACTED:282-289 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (20 lines × 2) lib/screens/home/scan_screen.dart:154— lib/screens/home/scan_screen.dart:154-173 | lib/screens/scan/main_scan_ui/scan_screen.dart:198-217 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (20 lines × 2) lib/screens/home/scan_screen.dart:764— lib/screens/home/scan_screen.dart:764-783 | lib/screens/scan/main_scan_ui/scan_screen.dart:68-87 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 2) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:93— lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:93-112 | lib/screens/scan_ui_screen.dart:178-197 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) lib/screens/scan/main_scan_ui/scan_log_listener.dart:33— lib/screens/scan/main_scan_ui/scan_log_listener.dart:33-52 | lib/widgets/scan_log_listener.dart:34-53 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_log_listener.dart` and `lib/widgets/scan_log_listener.dart` 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:318— lib/screens/vpn/NetworkProtectionScreen.dart:318-337 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:298-317 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/NetworkProtectionScreen.dart:318` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) lib/screens/vpn/services/full_vpn_location_map.dart:397— lib/screens/vpn/services/full_vpn_location_map.dart:397-416 | lib/vpn/services/full_vpn_location_map.dart:548-567 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_location_map.dart` and `lib/vpn/services/full_vpn_location_map.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/services/full_vpn_location_map.dart:397` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) lib/screens/home/scan_screen.dart:1409— lib/screens/home/scan_screen.dart:1409-1423 | lib/screens/scan/main_scan_ui/scan_screen.dart:1374-1388 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (15 lines × 2) lib/screens/scan_screen.dart:394— lib/screens/scan_screen.dart:394-408 | lib/screens/scan_ui_screen.dart:947-961 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:148— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:148-162 | lib/screens/vpn/NetworkProtectionScreen.dart:185-199 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/vpn/NetworkProtectionScreen.dart:181` calls `_loadUsage` and `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:144` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:686— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:686-700 | lib/screens/vpn/AdvancedNetworkProtection_screen.dart:1033-1047 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:686` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:784— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:784-798 | lib/screens/vpn/NetworkProtectionScreen.dart:923-937 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:955— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:955-969 | lib/screens/vpn/NetworkProtectionScreen.dart:1272-1286 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:955` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 3) lib/screens/home/scan_screen.dart:121— lib/screens/home/scan_screen.dart:121-132 | lib/screens/scan/main_scan_ui/scan_screen.dart:165-176 | lib/screens/scan_ui_screen.dart:334-345 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/home/scan_screen.dart:118` calls `MethodChannel` and `lib/screens/scan/main_scan_ui/scan_screen.dart:161` 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 × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:154— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:154-165 | lib/screens/vpn/NetworkProtectionScreen.dart:191-202 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:154-165 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:154` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:268— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:268-279 | lib/screens/vpn/NetworkProtectionScreen.dart:399-410 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:379-390 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/vpn/NetworkProtectionScreen.dart:396` calls `_loadUsage` and `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:265` 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 × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:205— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:205-216 | lib/screens/vpn/NetworkProtectionScreen.dart:268-279 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:249-260 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) lib/screens/home/scan_screen.dart:581— lib/screens/home/scan_screen.dart:581-592 | lib/screens/scan/main_scan_ui/scan_screen.dart:625-636 | lib/screens/scan_ui_screen.dart:741-752 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) lib/screens/home/scan_screen.dart:613— lib/screens/home/scan_screen.dart:613-624 | lib/screens/scan/main_scan_ui/scan_screen.dart:657-668 | lib/screens/scan_ui_screen.dart:771-782 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) REDACTED:643— REDACTED:643-652 | lib/screens/settings/widgets/settings_account_card.dart:71-80 | lib/screens/settings/widgets/settings_account_card.dart:100-109 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) lib/screens/home/scan_screen.dart:456— lib/screens/home/scan_screen.dart:456-465 | lib/screens/scan/main_scan_ui/scan_screen.dart:500-509 | lib/screens/scan_ui_screen.dart:640-649 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:456` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) lib/screens/home/scan_screen.dart:640— lib/screens/home/scan_screen.dart:640-649 | lib/screens/scan/main_scan_ui/scan_screen.dart:684-693 | lib/screens/scan_ui_screen.dart:795-804 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:640` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/home/scan_screen.dart:650` calls `toString`, `toInt` and `lib/screens/scan_ui_screen.dart:805` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) lib/screens/home/scan_screen.dart:681— lib/screens/home/scan_screen.dart:681-690 | lib/screens/scan/main_scan_ui/scan_screen.dart:725-734 | lib/screens/scan_ui_screen.dart:827-836 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:45— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:45-54 | lib/screens/vpn/NetworkProtectionScreen.dart:49-58 | lib/screens/vpn/dns/network_protection_models.dart:26-35 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:45` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) lib/screens/home/scan_screen.dart:1327— lib/screens/home/scan_screen.dart:1327-1336 | lib/screens/scan/main_scan_ui/scan_screen.dart:1292-1301 | lib/screens/scan_ui_screen.dart:1395-1404 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) lib/screens/scan/main_scan_ui/scan_log_listener.dart:18— lib/screens/scan/main_scan_ui/scan_log_listener.dart:18-27 | lib/widgets/scan_log_listener.dart:19-28 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_log_listener.dart` and `lib/widgets/scan_log_listener.dart` 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:551— lib/screens/vpn/NetworkProtectionScreen.dart:551-560 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:531-540 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) lib/screens/vpn/dns/NetworkProtectionScreen.dart:150— lib/screens/vpn/dns/NetworkProtectionScreen.dart:150-159 | lib/screens/vpn/dns/network_live_logs_screen.dart:28-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/dns/NetworkProtectionScreen.dart:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/vpn/dns/NetworkProtectionScreen.dart:160` calls `_bumpUi` and `lib/screens/vpn/dns/network_live_logs_screen.dart:38` 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) lib/screens/vpn/full_vpn_mode_screen.dart:622— lib/screens/vpn/full_vpn_mode_screen.dart:622-631 | lib/screens/vpn/full_vpn_mode_screen.dart:640-649 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/full_vpn_mode_screen.dart:622` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:706— lib/screens/vpn/services/full_vpn_backend.dart:706-715 | REDACTED:1014-1023 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) android/app/src/main/jniLibs/trimmed_Engine.rs:680— android/app/src/main/jniLibs/trimmed_Engine.rs:680-689 | android/app/src/main/jniLibs/trimmed_Engine.rs:693-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/app/src/main/jniLibs/trimmed_Engine.rs:680` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
XxxComment android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:1195— // XXX hook into external gesture listener — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TranscriptScreen.java:191— // XXX Figure out why this happens on Honeycomb — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TranscriptScreen.java:404— // XXX This probably shouldn't happen ... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TranscriptScreen.java:452— // XXX Trying to resize a finished TranscriptScreen? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:391— // XXX There has to be a faster way to do this ... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×5
Edited copy of a member (10 corresponding lines) REDACTED:1752— REDACTED:1752-1761 | lib/screens/home/security_report_screen.dart:597-607 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) lib/screens/apkAnalyser/apk_analyser_controller.dart:605— lib/screens/apkAnalyser/apk_analyser_controller.dart:605-615 | lib/screens/scan/detail_screen.dart:189-198 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) lib/terminal/sys_info.dart:43— lib/terminal/sys_info.dart:43-52 | lib/terminal/terminal_controller.dart:354-363 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:767— android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:767-776 | android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:778-787 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) android/app/src/main/jniLibs/trimmed_Engine.rs:566— android/app/src/main/jniLibs/trimmed_Engine.rs:566-575 | android/app/src/main/jniLibs/trimmed_Engine.rs:758-768 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (21 lines × 2) lib/screens/home/av_home_feature_row.dart:36— lib/screens/home/av_home_feature_row.dart:36-56 | lib/screens/home/scan_modes_screen.dart:242-262 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/av_home_feature_row.dart:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) lib/screens/home/scan_screen.dart:211— lib/screens/home/scan_screen.dart:211-231 | lib/screens/scan/main_scan_ui/scan_screen.dart:255-275 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) lib/screens/scan_ui_screen.dart:1721— lib/screens/scan_ui_screen.dart:1721-1741 | lib/screens/scan_ui_screen.dart:1784-1804 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_ui_screen.dart:1721` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:470— lib/screens/vpn/NetworkProtectionScreen.dart:470-490 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:450-470 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/NetworkProtectionScreen.dart:470` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:856— lib/screens/vpn/NetworkProtectionScreen.dart:856-876 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:836-856 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/NetworkProtectionScreen.dart:856` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) lib/screens/home/scan_modes_screen.dart:261— lib/screens/home/scan_modes_screen.dart:261-278 | lib/screens/settings/widgets/settings_setting_tile.dart:48-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_modes_screen.dart:261` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) lib/screens/home/scan_screen.dart:562— lib/screens/home/scan_screen.dart:562-579 | lib/screens/scan/main_scan_ui/scan_screen.dart:606-623 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) lib/screens/home/scan_screen.dart:594— lib/screens/home/scan_screen.dart:594-611 | lib/screens/scan/main_scan_ui/scan_screen.dart:638-655 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) lib/screens/home/security_report_screen.dart:242— lib/screens/home/security_report_screen.dart:242-259 | lib/screens/home/security_report_screen.dart:398-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/security_report_screen.dart:242` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:766— lib/screens/vpn/services/full_vpn_backend.dart:766-783 | REDACTED:1097-1114 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 3) REDACTED:853— REDACTED:853-866 | REDACTED:224-237 | lib/screens/scan/scheduled_scan_screen.dart:111-124 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:853` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 3) lib/screens/home/scan_screen.dart:664— lib/screens/home/scan_screen.dart:664-677 | lib/screens/scan/main_scan_ui/scan_screen.dart:708-721 | lib/screens/scan_ui_screen.dart:811-824 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 3) lib/screens/home/scan_screen.dart:1038— lib/screens/home/scan_screen.dart:1038-1051 | lib/screens/scan_screen.dart:707-722 | lib/screens/scan_ui_screen.dart:1143-1156 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan_screen.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:1038` it begins part-way through the construct above it, so those exact lines 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) lib/screens/home/scan_screen.dart:1039— lib/screens/home/scan_screen.dart:1039-1052 | lib/screens/scan/main_scan_ui/scan_screen.dart:1004-1017 | lib/screens/scan_ui_screen.dart:1144-1157 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:154— android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:154-167 | android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:178-191 | android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:422-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 `android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:154` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) lib/screens/home/device_security_screen.dart:258— lib/screens/home/device_security_screen.dart:258-271 | lib/screens/home/device_security_screen.dart:767-780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/device_security_screen.dart:258` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) lib/screens/scan_ui_screen.dart:1589— lib/screens/scan_ui_screen.dart:1589-1602 | lib/screens/scan_ui_screen.dart:1764-1777 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_ui_screen.dart:1589` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:728— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:728-741 | lib/screens/vpn/NetworkProtectionScreen.dart:867-880 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:728` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) lib/services/realtime_protection_service.dart:676— lib/services/realtime_protection_service.dart:676-689 | lib/services/realtime_protection_service.dart:749-762 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) lib/services/realtime_protection_service.dart:694— lib/services/realtime_protection_service.dart:694-707 | lib/services/realtime_protection_service.dart:760-773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/realtime_protection_service.dart:694` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/services/realtime_protection_service.dart:709` calls `unawaited`, `_saveIndex` and `lib/services/realtime_protection_service.dart:774` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) lib/screens/home/scan_screen.dart:268— lib/screens/home/scan_screen.dart:268-278 | lib/screens/scan/main_scan_ui/scan_screen.dart:312-322 | lib/screens/scan_ui_screen.dart:473-483 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:268` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) lib/screens/home/scan_screen.dart:1338— lib/screens/home/scan_screen.dart:1338-1348 | lib/screens/scan/main_scan_ui/scan_screen.dart:1303-1313 | lib/screens/scan_ui_screen.dart:1406-1416 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 3) lib/screens/home/scan_screen.dart:2372— lib/screens/home/scan_screen.dart:2372-2382 | lib/screens/scan/main_scan_ui/scan_screen.dart:2337-2347 | lib/screens/scan_ui_screen.dart:1917-1927 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:962— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:962-972 | lib/screens/vpn/NetworkProtectionScreen.dart:1279-1289 | lib/screens/vpn/dns/network_live_logs_screen.dart:32-42 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:962` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) lib/services/purchase_service.dart:118— lib/services/purchase_service.dart:118-128 | lib/services/purchase_service.dart:200-210 | lib/services/purchase_service.dart:480-490 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/purchase_service.dart:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/apkAnalyser/apk_analyser.dart:185— lib/screens/apkAnalyser/apk_analyser.dart:185-267 | lib/screens/apkAnalyser/apk_analyser.dart:743-860 | lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:36-144 | lib/screens/scan_ui_screen.dart:1958-2066 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/apkAnalyser/apk_analyser.dart:352— lib/screens/apkAnalyser/apk_analyser.dart:352-409 | lib/screens/home/scan_screen.dart:1350-1401 | lib/screens/scan/main_scan_ui/scan_screen.dart:1315-1366 | REDACTED:875-931 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:22— lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:22-112 | lib/screens/scan_screen.dart:94-164 | lib/screens/scan_ui_screen.dart:109-197 | lib/services/scan_controller.dart:91-161 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/vpn/services/full_vpn_backend.dart:627— lib/screens/vpn/services/full_vpn_backend.dart:627-650 | lib/screens/vpn/services/full_vpn_backend.dart:652-678 | REDACTED:838-861 | REDACTED:863-889 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×4
Edited copy of a member (12 corresponding lines) lib/screens/scan/main_scan_ui/log_buffer.dart:9— lib/screens/scan/main_scan_ui/log_buffer.dart:9-20 | lib/screens/scan_ui_screen.dart:30-41 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) lib/screens/vpn/services/full_vpn_location_map.dart:119— lib/screens/vpn/services/full_vpn_location_map.dart:119-130 | lib/vpn/services/full_vpn_location_map.dart:193-210 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) lib/services/purchase_service.dart:153— lib/services/purchase_service.dart:153-164 | lib/services/purchase_service.dart:166-177 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) REDACTED:1502— REDACTED:1502-1513 | lib/screens/home/security_report_screen.dart:27-38 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×4
Edited copy of a member (15 corresponding lines) android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/backend_port/storage/FlutterPrefsBridge.kt:101— android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/backend_port/storage/FlutterPrefsBridge.kt:101-115 | android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/wireguard/CSWireGuardService.kt:301-315 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:196— lib/screens/vpn/services/full_vpn_backend.dart:196-210 | REDACTED:262-280 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) lib/screens/vpn/services/full_vpn_location_map.dart:91— lib/screens/vpn/services/full_vpn_location_map.dart:91-105 | lib/vpn/services/full_vpn_location_map.dart:163-177 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) lib/screens/home/device_security_screen.dart:828— lib/screens/home/device_security_screen.dart:828-842 | REDACTED:1116-1130 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×4
Edited copy of a member (8 corresponding lines) REDACTED:130— REDACTED:130-139 | REDACTED:141-148 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) lib/utils/worker_hash_isolate.dart:25— lib/utils/worker_hash_isolate.dart:25-32 | lib/utils/worker_scan_isolate.dart:25-32 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) lib/screens/home/scan_modes_screen.dart:37— lib/screens/home/scan_modes_screen.dart:37-45 | REDACTED:226-233 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) lib/screens/vpn/services/full_vpn_location_map.dart:75— lib/screens/vpn/services/full_vpn_location_map.dart:75-82 | lib/vpn/services/full_vpn_location_map.dart:127-134 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (22 lines × 2) lib/screens/apkAnalyser/apk_analyser.dart:193— lib/screens/apkAnalyser/apk_analyser.dart:193-214 | lib/screens/apkAnalyser/apk_analyser.dart:748-769 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/apkAnalyser/apk_analyser.dart:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:92— lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:92-113 | lib/screens/scan_ui_screen.dart:2014-2035 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:92` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:845— lib/screens/vpn/services/full_vpn_backend.dart:845-866 | REDACTED:1176-1197 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (22 lines × 2) lib/screens/home/scan_screen.dart:44— lib/screens/home/scan_screen.dart:44-65 | lib/screens/scan/main_scan_ui/scan_screen.dart:89-110 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) lib/screens/apkAnalyser/apk_analyser.dart:913— lib/screens/apkAnalyser/apk_analyser.dart:913-927 | lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:196-210 | lib/screens/scan_ui_screen.dart:2118-2132 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/apkAnalyser/apk_analyser.dart:913` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot 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 × 3) REDACTED:874— REDACTED:874-888 | REDACTED:245-259 | lib/screens/scan/scheduled_scan_screen.dart:132-146 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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 (15 lines × 3) lib/screens/home/scan_screen.dart:793— lib/screens/home/scan_screen.dart:793-807 | lib/screens/scan/main_scan_ui/scan_screen.dart:815-829 | lib/screens/scan_ui_screen.dart:924-938 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (15 lines × 3) lib/screens/home/security_report_screen.dart:243— lib/screens/home/security_report_screen.dart:243-257 | lib/screens/home/security_report_screen.dart:327-341 | lib/screens/home/security_report_screen.dart:399-413 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/home/security_report_screen.dart:414` calls `Padding`, `fromLTRB` and `lib/screens/home/security_report_screen.dart:342` 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.
TodoComment lib/utils/defs_loader.dart:3— /// TODO: Verify defs are loaded — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:552— // TODO: See if we want to use the API level 11 constructor to get new flywheel feature. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:874— // TODO: handle forward deletes. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×3
Edited copy of a member (14 corresponding lines) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:41— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:41-54 | lib/screens/vpn/NetworkProtectionScreen.dart:45-58 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) REDACTED:1533— REDACTED:1533-1546 | lib/screens/home/security_report_screen.dart:528-542 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) lib/services/scan_session_service.dart:22— lib/services/scan_session_service.dart:22-37 | lib/services/scan_session_service.dart:70-83 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×3
Edited copy of a member (17 corresponding lines) lib/screens/home/scan_screen.dart:640— lib/screens/home/scan_screen.dart:640-656 | lib/screens/scan/main_scan_ui/scan_screen.dart:684-700 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) lib/screens/vpn/NetworkProtectionScreen.dart:281— lib/screens/vpn/NetworkProtectionScreen.dart:281-298 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:262-278 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) android/app/src/main/kotlin/com/colourswift/cssecurity/ShizukuBridge.kt:196— android/app/src/main/kotlin/com/colourswift/cssecurity/ShizukuBridge.kt:196-216 | android/app/src/main/kotlin/com/colourswift/cssecurity/ShizukuBridge.kt:221-237 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×3
Edited copy of a member (18 corresponding lines) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:148— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:148-165 | lib/screens/vpn/NetworkProtectionScreen.dart:185-202 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:955— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:955-972 | lib/screens/vpn/NetworkProtectionScreen.dart:1272-1289 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) lib/screens/vpn/dns/NetworkProtectionScreen.dart:148— lib/screens/vpn/dns/NetworkProtectionScreen.dart:148-165 | lib/screens/vpn/dns/network_live_logs_screen.dart:25-42 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×3
Edited copy of a member (5 corresponding lines) lib/screens/home/security_report_screen.dart:563— lib/screens/home/security_report_screen.dart:563-567 | lib/screens/home/security_report_screen.dart:588-595 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) REDACTED:138— REDACTED:138-142 | REDACTED:71-79 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) REDACTED:1295— REDACTED:1295-1299 | REDACTED:817-822 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (42 lines × 2) REDACTED:1150— REDACTED:1150-1191 | lib/screens/scan/scan_limits_screen.dart:119-160 — 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 `REDACTED:1150` it does not close everything it opens, so those 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, `REDACTED:1147` calls `InkWell`, `circular` and `lib/screens/scan/scan_limits_screen.dart:118` 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 (42 lines × 2) lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:36— lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:36-77 | lib/screens/scan_ui_screen.dart:1958-1999 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (42 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:566— lib/screens/vpn/services/full_vpn_backend.dart:566-607 | REDACTED:778-819 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/services/full_vpn_backend.dart:566` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/vpn/services/full_vpn_backend.dart:609` calls `toString` and `REDACTED:821` 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) REDACTED:1059— REDACTED:1059-1077 | REDACTED:421-439 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (19 lines × 2) lib/screens/home/scan_screen.dart:2309— lib/screens/home/scan_screen.dart:2309-2327 | lib/screens/scan/main_scan_ui/scan_screen.dart:2274-2292 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (19 lines × 2) lib/screens/vpn/services/full_vpn_location_map.dart:212— lib/screens/vpn/services/full_vpn_location_map.dart:212-230 | lib/vpn/services/full_vpn_location_map.dart:407-425 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_location_map.dart` and `lib/vpn/services/full_vpn_location_map.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/services/full_vpn_location_map.dart:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) lib/screens/home/av_home_drawer.dart:251— lib/screens/home/av_home_drawer.dart:251-266 | lib/screens/home/av_home_drawer.dart:295-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/av_home_drawer.dart:251` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) lib/screens/home/scan_screen.dart:968— lib/screens/home/scan_screen.dart:968-983 | lib/screens/scan/main_scan_ui/scan_screen.dart:967-982 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) lib/screens/vpn/full_vpn_mode_screen.dart:381— lib/screens/vpn/full_vpn_mode_screen.dart:381-396 | lib/screens/vpn/full_vpn_mode_screen.dart:419-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/full_vpn_mode_screen.dart:381` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 3) lib/screens/home/scan_screen.dart:285— lib/screens/home/scan_screen.dart:285-296 | lib/screens/scan/main_scan_ui/scan_screen.dart:329-340 | lib/screens/scan_ui_screen.dart:494-507 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:285` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/scan_ui_screen.dart:493` calls `_appendScanLog` and `lib/screens/home/scan_screen.dart:284` 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–14 lines × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:175— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:175-188 | lib/screens/vpn/NetworkProtectionScreen.dart:228-241 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:192-203 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–14 lines × 3) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:380— android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:380-393 | android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:395-406 | android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:410-422 — 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 `android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:410` it begins part-way through the construct above it, so those 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 × 4) lib/screens/home/scan_screen.dart:1795— lib/screens/home/scan_screen.dart:1795-1805 | lib/screens/home/scan_screen.dart:1941-1951 | lib/screens/scan/main_scan_ui/scan_screen.dart:1760-1770 | lib/screens/scan/main_scan_ui/scan_screen.dart:1906-1916 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:1795` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) lib/screens/vpn/services/full_vpn_backend.dart:628— lib/screens/vpn/services/full_vpn_backend.dart:628-638 | lib/screens/vpn/services/full_vpn_backend.dart:653-663 | REDACTED:839-849 | REDACTED:864-874 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) lib/screens/home/scan_screen.dart:142— lib/screens/home/scan_screen.dart:142-152 | lib/screens/scan/main_scan_ui/scan_screen.dart:186-196 | lib/screens/scan_screen.dart:206-216 | lib/screens/scan_ui_screen.dart:376-386 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) lib/screens/apkAnalyser/apk_analyser.dart:767— lib/screens/apkAnalyser/apk_analyser.dart:767-776 | lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:69-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/apkAnalyser/apk_analyser.dart:767` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) lib/screens/scan_screen.dart:725— lib/screens/scan_screen.dart:725-735 | lib/services/scan_controller.dart:273-282 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/services/scan_controller.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_screen.dart: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 (10–11 lines × 2) lib/screens/settings/widgets/settings_account_card.dart:40— lib/screens/settings/widgets/settings_account_card.dart:40-50 | lib/screens/settings/widgets/settings_pro_card.dart:113-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 `lib/screens/settings/widgets/settings_account_card.dart:40` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) lib/screens/home/scan_screen.dart:768— lib/screens/home/scan_screen.dart:768-775 | lib/screens/scan/main_scan_ui/scan_screen.dart:72-79 | lib/services/scan_controller.dart:218-225 | lib/terminal/terminal_controller.dart:122-129 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 4) REDACTED:223— REDACTED:223-230 | REDACTED:236-243 | REDACTED:294-301 | lib/widgets/engine_setup.dart:219-226 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 4) lib/screens/vpn/NetworkProtectionScreen.dart:300— lib/screens/vpn/NetworkProtectionScreen.dart:300-307 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:280-287 | lib/screens/vpn/services/full_vpn_backend.dart:809-816 | REDACTED:1140-1147 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
_ScanScreenState._applyHeadlessEvent (cyclomatic 51) lib/screens/home/scan_screen.dart:237— _ScanScreenState._applyHeadlessEvent has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_ScanScreenState._applyHeadlessEvent (cyclomatic 51) lib/screens/scan/main_scan_ui/scan_screen.dart:281— _ScanScreenState._applyHeadlessEvent has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_ScanScreenState._runSingleFileScan (cyclomatic 27) lib/screens/home/scan_screen.dart:839— _ScanScreenState._runSingleFileScan 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.
_ScanScreenState._runSingleFileScan (cyclomatic 27) lib/screens/scan/main_scan_ui/scan_screen.dart:838— _ScanScreenState._runSingleFileScan 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.
_NetworkAdvancedScreenState._blocklistsTab (cyclomatic 26) lib/screens/vpn/NetworkProtectionScreen.dart:579— _NetworkAdvancedScreenState._blocklistsTab 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.
_NetworkAdvancedScreenState._blocklistsTab (cyclomatic 26) lib/screens/vpn/dns/NetworkProtectionScreen.dart:559— _NetworkAdvancedScreenState._blocklistsTab 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.
crate::android::app::src::main::jniLibs::trimmed_Engine::av_scan_inner (cyclomatic 23) android/app/src/main/jniLibs/trimmed_Engine.rs:590— crate::android::app::src::main::jniLibs::trimmed_Engine::av_scan_inner 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.
crate::android::app::src::main::jniLibs::trimmed_Engine::init_engine_any (cyclomatic 17) android/app/src/main/jniLibs/trimmed_Engine.rs:377— crate::android::app::src::main::jniLibs::trimmed_Engine::init_engine_any 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.
FullVpnController.fetchUsage (cyclomatic 22) lib/screens/vpn/services/full_vpn_backend.dart:323— FullVpnController.fetchUsage 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. This is NOT this file's highest cyclomatic complexity: FullVpnController.statusText (cyclomatic 26) 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.
FullVpnController.fetchUsage (cyclomatic 22) REDACTED:457— FullVpnController.fetchUsage 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.
_NetworkAdvancedScreenState._usageCard (cyclomatic 21) lib/screens/vpn/NetworkProtectionScreen.dart:978— _NetworkAdvancedScreenState._usageCard 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.
_NetworkAdvancedScreenState._usageCard (cyclomatic 21) lib/screens/vpn/dns/NetworkProtectionScreen.dart:974— _NetworkAdvancedScreenState._usageCard 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.
_ScanScreenState._runHeadlessMultiScan (cyclomatic 17) lib/screens/home/scan_screen.dart:380— _ScanScreenState._runHeadlessMultiScan 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.
_ScanScreenState._runHeadlessMultiScan (cyclomatic 17) lib/screens/scan/main_scan_ui/scan_screen.dart:424— _ScanScreenState._runHeadlessMultiScan 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.
_ScanScreenState._applyHeadlessEvent (cognitive 85) lib/screens/home/scan_screen.dart:237— _ScanScreenState._applyHeadlessEvent has cognitive complexity 85 (threshold 15). Drivers by points: if/else 44 (77 pts), boolean chains 8 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ScanScreenState._applyHeadlessEvent (cognitive 85) lib/screens/scan/main_scan_ui/scan_screen.dart:281— _ScanScreenState._applyHeadlessEvent has cognitive complexity 85 (threshold 15). Drivers by points: if/else 44 (77 pts), boolean chains 8 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::android::app::src::main::jniLibs::trimmed_Engine::av_scan_inner (cognitive 51) android/app/src/main/jniLibs/trimmed_Engine.rs:590— crate::android::app::src::main::jniLibs::trimmed_Engine::av_scan_inner has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 7 (19 pts), match/switch 2 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::android::app::src::main::jniLibs::trimmed_Engine::init_engine_any (cognitive 33) android/app/src/main/jniLibs/trimmed_Engine.rs:377— crate::android::app::src::main::jniLibs::trimmed_Engine::init_engine_any has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ScanScreenState._runSingleFileScan (cognitive 44) lib/screens/home/scan_screen.dart:839— _ScanScreenState._runSingleFileScan has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 6, error handling 2 (5 pts), ternaries 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ScanScreenState._runSingleFileScan (cognitive 44) lib/screens/scan/main_scan_ui/scan_screen.dart:838— _ScanScreenState._runSingleFileScan has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 6, error handling 2 (5 pts), ternaries 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NetworkAdvancedScreenState._loadUsage (cognitive 29) lib/screens/vpn/NetworkProtectionScreen.dart:492— _NetworkAdvancedScreenState._loadUsage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 3 (10 pts), boolean chains 2, error handling 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_NetworkAdvancedScreenState._loadUsage (cognitive 29) lib/screens/vpn/dns/NetworkProtectionScreen.dart:472— _NetworkAdvancedScreenState._loadUsage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 3 (10 pts), boolean chains 2, error handling 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FullVpnController.fetchUsage (cognitive 27) lib/screens/vpn/services/full_vpn_backend.dart:323— FullVpnController.fetchUsage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 5, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FullVpnController.fetchUsage (cognitive 27) REDACTED:457— FullVpnController.fetchUsage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 5, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NetworkAdvancedScreenState._usageCard (cognitive 26) lib/screens/vpn/NetworkProtectionScreen.dart:978— _NetworkAdvancedScreenState._usageCard has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (13 pts), if/else 6 (8 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_NetworkAdvancedScreenState._usageCard (cognitive 26) lib/screens/vpn/dns/NetworkProtectionScreen.dart:974— _NetworkAdvancedScreenState._usageCard has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (13 pts), if/else 6 (8 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_NetworkAdvancedScreenState._blocklistsTab (cognitive 25) lib/screens/vpn/NetworkProtectionScreen.dart:579— _NetworkAdvancedScreenState._blocklistsTab has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, ternaries 10, 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.
_NetworkAdvancedScreenState._blocklistsTab (cognitive 25) lib/screens/vpn/dns/NetworkProtectionScreen.dart:559— _NetworkAdvancedScreenState._blocklistsTab has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, ternaries 10, 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.
_ScanScreenState._runHeadlessMultiScan (cognitive 24) lib/screens/home/scan_screen.dart:380— _ScanScreenState._runHeadlessMultiScan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (18 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.
_ScanScreenState._runHeadlessMultiScan (cognitive 24) lib/screens/scan/main_scan_ui/scan_screen.dart:424— _ScanScreenState._runHeadlessMultiScan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (18 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.
_ScanScreenState._checkAndStart (cognitive 19) lib/screens/scan_screen.dart:299— _ScanScreenState._checkAndStart has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ScanScreenState._checkAndStart (cognitive 19) lib/screens/scan_ui_screen.dart:887— _ScanScreenState._checkAndStart has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ScanScreenState._cloudVerifyOne (cognitive 17) lib/screens/home/scan_screen.dart:968— _ScanScreenState._cloudVerifyOne has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (4 pts), loops 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ScanScreenState._cloudVerifyOne (cognitive 17) lib/screens/scan/main_scan_ui/scan_screen.dart:967— _ScanScreenState._cloudVerifyOne has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (4 pts), loops 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) lib/screens/home/scan_screen.dart:763— lib/screens/home/scan_screen.dart:763-783 | REDACTED:30-61 | lib/screens/scan/main_scan_ui/scan_screen.dart:67-87 | lib/screens/scan_screen.dart:299-337 | lib/screens/scan_ui_screen.dart:887-922 | lib/services/scan_controller.dart:211-230 | lib/terminal/terminal_controller.dart:116-137 — 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.
Members sharing a duplicated core (7 members, 50+ identical tokens) lib/screens/home/scan_screen.dart:839— lib/screens/home/scan_screen.dart:839-966 | lib/screens/home/scan_screen.dart:1010-1128 | lib/screens/scan/main_scan_ui/scan_screen.dart:838-965 | lib/screens/scan/main_scan_ui/scan_screen.dart:1002-1093 | lib/screens/scan_screen.dart:686-745 | lib/screens/scan_ui_screen.dart:963-1052 | lib/screens/scan_ui_screen.dart:1131-1215 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Edited copy of a member (60 corresponding lines) · ×2
Edited copy of a member (60 corresponding lines) lib/screens/home/scan_screen.dart:2199— lib/screens/home/scan_screen.dart:2199-2258 | lib/screens/scan/main_scan_ui/scan_screen.dart:2164-2223 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (60 corresponding lines) lib/screens/home/device_security_screen.dart:750— lib/screens/home/device_security_screen.dart:750-818 | lib/screens/settings/widgets/settings_setting_tile.dart:19-78 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (53 corresponding lines) · ×2
Edited copy of a member (53 corresponding lines) lib/screens/vpn/NetworkProtectionScreen.dart:213— lib/screens/vpn/NetworkProtectionScreen.dart:213-266 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:176-228 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (53 corresponding lines) android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:569— android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:569-622 | android/app/src/main/kotlin/com/colourswift/cssecurity/MainActivity.kt:663-715 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:290— lib/screens/vpn/services/full_vpn_backend.dart:290-321 | REDACTED:419-455 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:255— lib/screens/vpn/services/full_vpn_backend.dart:255-288 | REDACTED:345-376 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×2
Edited copy of a member (24 corresponding lines) lib/screens/scan/cleaner_app_manager_screen.dart:151— lib/screens/scan/cleaner_app_manager_screen.dart:151-174 | lib/screens/scan/cleaner_pro_screen.dart:82-114 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) lib/services/purchase_service.dart:113— lib/services/purchase_service.dart:113-136 | lib/services/purchase_service.dart:477-504 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×2
Edited copy of a member (21 corresponding lines) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:817— android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:817-839 | android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:911-931 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) lib/screens/scan_screen.dart:1001— lib/screens/scan_screen.dart:1001-1024 | lib/screens/scanscreen.dart:57-77 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×2
Edited copy of a member (16 corresponding lines) lib/utils/worker_hash_isolate.dart:34— lib/utils/worker_hash_isolate.dart:34-49 | lib/utils/worker_scan_isolate.dart:34-49 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) lib/screens/scan_screen.dart:983— lib/screens/scan_screen.dart:983-999 | lib/screens/scan_ui_screen.dart:1217-1232 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×2
Edited copy of a member (9 corresponding lines) REDACTED:69— REDACTED:69-77 | REDACTED:79-87 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) REDACTED:312— REDACTED:312-323 | lib/screens/vpn/services/full_vpn_backend.dart:238-246 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×2
Edited copy of a member (11 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:226— lib/screens/vpn/services/full_vpn_backend.dart:226-236 | REDACTED:297-310 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) lib/vpn/services/full_vpn_location_map.dart:179— lib/vpn/services/full_vpn_location_map.dart:179-191 | lib/screens/vpn/services/full_vpn_location_map.dart:107-117 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (49 lines × 2) lib/screens/home/scan_screen.dart:2210— lib/screens/home/scan_screen.dart:2210-2258 | lib/screens/scan/main_scan_ui/scan_screen.dart:2175-2223 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:2210` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (49 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:806— lib/screens/vpn/NetworkProtectionScreen.dart:806-854 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:786-834 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/NetworkProtectionScreen.dart:806` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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 `p` to `_UpstreamPreset` in one and `UpstreamPreset` 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 (38 lines × 2) REDACTED:334— REDACTED:334-371 | REDACTED:184-221 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:334` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (38 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:939— lib/screens/vpn/NetworkProtectionScreen.dart:939-976 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:935-972 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (36 lines × 2) lib/screens/home/scan_screen.dart:495— lib/screens/home/scan_screen.dart:495-530 | lib/screens/scan/main_scan_ui/scan_screen.dart:539-574 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (36 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:412— lib/screens/vpn/NetworkProtectionScreen.dart:412-447 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:392-427 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (33 lines × 2) lib/screens/home/scan_screen.dart:1369— lib/screens/home/scan_screen.dart:1369-1401 | lib/screens/scan/main_scan_ui/scan_screen.dart:1334-1366 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:1369` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33 lines × 2) lib/screens/vpn/services/full_vpn_location_map.dart:235— lib/screens/vpn/services/full_vpn_location_map.dart:235-267 | lib/vpn/services/full_vpn_location_map.dart:430-462 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_location_map.dart` and `lib/vpn/services/full_vpn_location_map.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/services/full_vpn_location_map.dart:235` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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) REDACTED:852— REDACTED:852-883 | REDACTED:223-254 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:852` it does not close everything it opens, so those exact lines 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) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:389— android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:389-420 | android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:428-459 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:389` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30 lines × 2) REDACTED:345— REDACTED:345-374 | REDACTED:441-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:446— lib/screens/vpn/services/full_vpn_backend.dart:446-475 | REDACTED:623-652 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (28 lines × 2) REDACTED:910— REDACTED:910-937 | REDACTED:278-305 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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.
Duplicated block (28 lines × 2) lib/screens/home/scan_screen.dart:716— lib/screens/home/scan_screen.dart:716-743 | lib/screens/scan/main_scan_ui/scan_screen.dart:760-787 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (25–26 lines × 2) lib/screens/scan_screen.dart:1404— lib/screens/scan_screen.dart:1404-1428 | lib/services/scan_controller.dart:409-434 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/services/scan_controller.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–26 lines × 2) lib/services/purchase_service.dart:338— lib/services/purchase_service.dart:338-362 | lib/services/purchase_service.dart:390-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/purchase_service.dart:338` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 3) lib/screens/apkAnalyser/apk_analyser.dart:353— lib/screens/apkAnalyser/apk_analyser.dart:353-376 | lib/screens/home/scan_screen.dart:1353-1376 | lib/screens/scan/main_scan_ui/scan_screen.dart:1318-1341 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/apkAnalyser/apk_analyser.dart: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24 lines × 3) lib/screens/home/scan_screen.dart:854— lib/screens/home/scan_screen.dart:854-877 | lib/screens/scan/main_scan_ui/scan_screen.dart:853-876 | lib/screens/scan_ui_screen.dart:968-991 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (22–23 lines × 2) REDACTED:292— REDACTED:292-313 | REDACTED:154-176 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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, `REDACTED:314` calls `_initVpn` and `REDACTED:177` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22–23 lines × 2) lib/screens/quarantine/quarantine_screen.dart:491— lib/screens/quarantine/quarantine_screen.dart:491-512 | lib/screens/quarantine/quarantine_screen.dart:608-630 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/quarantine/quarantine_screen.dart:491` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) REDACTED:1079— REDACTED:1079-1101 | REDACTED:441-463 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (23 lines × 2) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:45— lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:45-67 | lib/screens/scan_ui_screen.dart:130-152 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/scan_ui_screen.dart:127` calls `exit` and `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:42` 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 (22 lines × 3) lib/screens/home/scan_screen.dart:2199— lib/screens/home/scan_screen.dart:2199-2220 | lib/screens/scan/main_scan_ui/scan_screen.dart:2164-2185 | lib/screens/scan_ui_screen.dart:1748-1769 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:2199` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 3) lib/screens/settings/full_vpn_settings_screen.dart:328— lib/screens/settings/full_vpn_settings_screen.dart:328-349 | lib/screens/settings/full_vpn_settings_screen.dart:365-386 | lib/screens/settings/full_vpn_settings_screen.dart:408-429 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/full_vpn_settings_screen.dart:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19–20 lines × 2) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:25— lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:25-43 | lib/services/scan api/headless_scan.dart:134-153 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart` and `lib/services/scan api/headless_scan.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19–20 lines × 2) lib/screens/scan_screen.dart:934— lib/screens/scan_screen.dart:934-953 | lib/services/scan_controller.dart:355-373 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/services/scan_controller.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_screen.dart:934` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 3) lib/screens/home/scan_screen.dart:476— lib/screens/home/scan_screen.dart:476-493 | lib/screens/scan/main_scan_ui/scan_screen.dart:520-537 | lib/screens/scan_ui_screen.dart:660-677 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:476` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:315— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:315-332 | lib/screens/vpn/NetworkProtectionScreen.dart:466-483 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:446-463 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:315` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/vpn/NetworkProtectionScreen.dart:484` calls `_loadUsage` and `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:333` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:298— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:298-313 | lib/screens/vpn/NetworkProtectionScreen.dart:449-464 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:429-444 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:552— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:552-567 | lib/screens/vpn/NetworkProtectionScreen.dart:801-816 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:781-796 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `p` to `_UpstreamPreset` in one and `UpstreamPreset` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/vpn/NetworkProtectionScreen.dart:818` calls `of` and `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:569` 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–15 lines × 2) lib/screens/home/scan_screen.dart:824— lib/screens/home/scan_screen.dart:824-837 | lib/services/scan_controller.dart:233-247 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/services/scan_controller.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14–15 lines × 2) lib/screens/settings/widgets/settings_pro_card.dart:45— lib/screens/settings/widgets/settings_pro_card.dart:45-58 | lib/screens/settings/widgets/settings_pro_card.dart:123-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/widgets/settings_pro_card.dart:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) lib/screens/scan/scheduled_scan_screen.dart:363— lib/screens/scan/scheduled_scan_screen.dart:363-375 | lib/screens/scan/scheduled_scan_screen.dart:438-450 | lib/screens/scan/scheduled_scan_screen.dart:505-517 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/scheduled_scan_screen.dart:363` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:574— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:574-586 | lib/screens/vpn/NetworkProtectionScreen.dart:825-837 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:805-817 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:574` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `p` to `_UpstreamPreset` in one and `UpstreamPreset` 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–13 lines × 2) lib/services/realtime_protection_service.dart:815— lib/services/realtime_protection_service.dart:815-826 | lib/services/realtime_protection_service.dart:829-841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/realtime_protection_service.dart:829` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) lib/services/scan_controller.dart:214— lib/services/scan_controller.dart:214-226 | lib/terminal/terminal_controller.dart:119-130 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/scan_controller.dart:214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) lib/screens/vpn/full_vpn_mode_screen.dart:572— lib/screens/vpn/full_vpn_mode_screen.dart:572-580 | lib/screens/vpn/full_vpn_mode_screen.dart:622-630 | lib/screens/vpn/full_vpn_mode_screen.dart:640-648 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/full_vpn_mode_screen.dart: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 (9 lines × 3) lib/screens/vpn/services/full_vpn_backend.dart:256— lib/screens/vpn/services/full_vpn_backend.dart:256-264 | REDACTED:346-354 | REDACTED:379-387 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/services/full_vpn_backend.dart:256` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) lib/screens/scan_ui_screen.dart:359— lib/screens/scan_ui_screen.dart:359-366 | lib/services/realtime_protection_service.dart:530-539 | lib/services/realtime_protection_service.dart:560-569 — before extracting anything, compare `lib/screens/scan_ui_screen.dart` and `lib/services/realtime_protection_service.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_ui_screen.dart:359` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:120— lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:120-127 | lib/screens/scan_ui_screen.dart:205-212 | lib/services/scan api/headless_scan.dart:193-200 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) lib/screens/scan/cleaner_app_manager_screen.dart:77— lib/screens/scan/cleaner_app_manager_screen.dart:77-83 | lib/screens/scan/detail_screen.dart:114-119 | lib/screens/scan/detail_screen.dart:150-155 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/cleaner_app_manager_screen.dart:77` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:377— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:377-382 | lib/screens/vpn/NetworkProtectionScreen.dart:572-577 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:552-557 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Off the main sequence: usage_stats (pub) — usage_stats (pub): abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: device_apps (pub) — device_apps (pub): abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Sync-over-async blocking lib/foundation.dart:35— `_startScan` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
Sync-over-async blocking lib/services/cache_manager.dart:5— `clearAll` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
SystemWatcher.poll (cyclomatic 55) android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcher.kt:275— SystemWatcher.poll 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.
TermKeyListener.mapControlChar (cyclomatic 55) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:429— TermKeyListener.mapControlChar has cyclomatic complexity 55 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FullUnicodeLine.setChar (cyclomatic 38) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:925— FullUnicodeLine.setChar 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.
TerminalEmulator.doEscLeftSquareBracket (cyclomatic 37) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:1173— TerminalEmulator.doEscLeftSquareBracket has cyclomatic complexity 37 (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.
TerminalEmulator.selectGraphicRendition (cyclomatic 36) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:1401— TerminalEmulator.selectGraphicRendition has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_ScanScreenState._scanFiles (cyclomatic 35) lib/screens/scan_screen.dart:816— _ScanScreenState._scanFiles 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.
TermKeyListener.keyDown (cyclomatic 35) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:512— TermKeyListener.keyDown 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.
FullVpnController._connectInternal (cyclomatic 34) REDACTED:549— FullVpnController._connectInternal 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.
MainActivity.configureFlutterEngine (cyclomatic 34) android/app/src/main/kotlin/com/colourswift/cssecurity/MainActivity.kt:296— MainActivity.configureFlutterEngine has cyclomatic complexity 34 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
_CleanerDetailScreenState.build (cyclomatic 33) lib/screens/scan/detail_screen.dart:200— _CleanerDetailScreenState.build has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_ScanScreenState._applyHeadlessEvent (cyclomatic 33) lib/screens/scan_ui_screen.dart:468— _ScanScreenState._applyHeadlessEvent 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.
_FullVpnModeScreenState._connectionScreen (cyclomatic 33) lib/screens/vpn/full_vpn_mode_screen.dart:457— _FullVpnModeScreenState._connectionScreen 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.
TerminalEmulator.process (cyclomatic 33) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:690— TerminalEmulator.process 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.
SettingsScreenState.build (cyclomatic 32) REDACTED:955— SettingsScreenState.build has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VpnConnectionController.runConnect (cyclomatic 32) android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/backend_port/core/VpnConnectionController.kt:320— VpnConnectionController.runConnect has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TerminalEmulator.updateSize (cyclomatic 31) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:442— TerminalEmulator.updateSize 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.
TranscriptScreen.internalGetTranscriptText (cyclomatic 31) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TranscriptScreen.java:347— TranscriptScreen.internalGetTranscriptText 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.
SystemWatcherUserService.externalSnapshot (cyclomatic 28) android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:256— SystemWatcherUserService.externalSnapshot 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.
_AvHomeScreenState._loadProtectionState (cyclomatic 24) REDACTED:465— _AvHomeScreenState._loadProtectionState 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.
SystemWatcher.selectFsAttribution (cyclomatic 24) android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcher.kt:680— SystemWatcher.selectFsAttribution 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.
AXTerminalPlugin.register (cyclomatic 24) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/bridge/AXTerminalPlugin.kt:33— AXTerminalPlugin.register 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.
TranscriptScreen.drawText (cyclomatic 24) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TranscriptScreen.java:178— TranscriptScreen.drawText 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.
EmulatorView.createLinks (cyclomatic 24) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:281— EmulatorView.createLinks 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.
ScanWorker._entry (cyclomatic 23) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:22— ScanWorker._entry 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.
_ScanScreenState._runSingleAppScan (cyclomatic 22) lib/screens/home/scan_screen.dart:1010— _ScanScreenState._runSingleAppScan 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.
_CleanerLitePaneState.build (cyclomatic 22) lib/screens/scan/cleaner_lite_screen.dart:311— _CleanerLitePaneState.build has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ScanWorker._entry (cyclomatic 22) lib/screens/scan_ui_screen.dart:109— ScanWorker._entry 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.
PurchaseService._handlePurchaseUpdates (cyclomatic 22) lib/services/purchase_service.dart:287— PurchaseService._handlePurchaseUpdates 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.
RealtimeProtectionService._runScheduledScan (cyclomatic 22) lib/services/realtime_protection_service.dart:330— RealtimeProtectionService._runScheduledScan 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.
TerminalController._buildCommands (cyclomatic 22) lib/terminal/terminal_controller.dart:160— TerminalController._buildCommands 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.
InterceptOutputStream.processByte (cyclomatic 22) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/bridge/PtyTermSession.kt:190— InterceptOutputStream.processByte 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.
UnicodeTranscript.blockCopy (cyclomatic 22) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:375— UnicodeTranscript.blockCopy 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.
UnicodeTranscript.resize (cyclomatic 22) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:149— UnicodeTranscript.resize 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.
FastAppsPlugin.onMethodCall (cyclomatic 21) android/app/src/main/kotlin/com/colourswift/cssecurity/MainActivity.kt:49— FastAppsPlugin.onMethodCall 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.
DeviceAppsPlugin.onMethodCall (cyclomatic 21) plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:80— DeviceAppsPlugin.onMethodCall 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.
PurchaseService._buySubscriptionBasePlan (cyclomatic 20) lib/services/purchase_service.dart:187— PurchaseService._buySubscriptionBasePlan 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.
QuarantineService.listAll (cyclomatic 20) lib/services/quarantine_service.dart:299— QuarantineService.listAll 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.
TerminalEmulator.doEscLSBQuest (cyclomatic 20) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:925— TerminalEmulator.doEscLSBQuest 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.
_ScheduledScansScreenState.build (cyclomatic 19) lib/screens/scan/scheduled_scan_screen.dart:196— _ScheduledScansScreenState.build has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_ScanScreenState._runSmartScan (cyclomatic 19) lib/screens/scan_screen.dart:410— _ScanScreenState._runSmartScan 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.
CommunitySubmissionService.processManualDetections (cyclomatic 19) lib/services/scan api/community_submissions/community_submission_service.dart:157— CommunitySubmissionService.processManualDetections 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.
_ProScreenState.build (cyclomatic 18) lib/screens/pro/pro_screen.dart:497— _ProScreenState.build has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_CleanerLitePaneState._runCleaner (cyclomatic 18) lib/screens/scan/cleaner_lite_screen.dart:58— _CleanerLitePaneState._runCleaner 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.
_ScanScreenState._runSingleAppScan (cyclomatic 18) lib/screens/scan/main_scan_ui/scan_screen.dart:1002— _ScanScreenState._runSingleAppScan 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.
LiteVpnController._fetchExitLocation (cyclomatic 18) lib/screens/vpn/lite_vpn_controller.dart:398— LiteVpnController._fetchExitLocation 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.
RealtimeProtectionService._scanSingleFile (cyclomatic 18) lib/services/realtime_protection_service.dart:642— RealtimeProtectionService._scanSingleFile 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.
UnicodeTranscript.getLine (cyclomatic 18) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:604— UnicodeTranscript.getLine 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.
ApkAnalyserController.analyseApk (cyclomatic 17) lib/screens/apkAnalyser/apk_analyser_controller.dart:366— ApkAnalyserController.analyseApk 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.
_CleanerLitePaneState._card (cyclomatic 17) lib/screens/scan/cleaner_lite_screen.dart:548— _CleanerLitePaneState._card 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.
_CleanerProPaneState._scanLogs (cyclomatic 17) lib/screens/scan/cleaner_pro_screen.dart:116— _CleanerProPaneState._scanLogs 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.
UnicodeTranscript.charWidth (cyclomatic 17) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:515— UnicodeTranscript.charWidth 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.
PaintRenderer.drawTextRun (cyclomatic 17) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/render/PaintRenderer.java:37— PaintRenderer.drawTextRun 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.
_ScanScreenState._startScan (cyclomatic 16) lib/foundation.dart:35— _ScanScreenState._startScan 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.
_SafeWebViewScreenState._verifyAndLoad (cyclomatic 16) lib/screens/link checker/webview_screen.dart:68— _SafeWebViewScreenState._verifyAndLoad 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.
_AppManagerScreenState.build (cyclomatic 16) lib/screens/scan/cleaner_app_manager_screen.dart:295— _AppManagerScreenState.build has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_ScanScreenState._buildResult (cyclomatic 16) lib/screens/scan_screen.dart:1124— _ScanScreenState._buildResult 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.
_ScanScreenState._runSingleFileScan (cyclomatic 16) lib/screens/scan_ui_screen.dart:963— _ScanScreenState._runSingleFileScan 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.
ScanController.scanFiles (cyclomatic 16) lib/services/scan_controller.dart:291— ScanController.scanFiles 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.
CSForegroundService.startPackageReceiver (cyclomatic 16) android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:706— CSForegroundService.startPackageReceiver 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.
SystemWatcher.poll (cognitive 91) android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcher.kt:275— SystemWatcher.poll has cognitive complexity 91 (threshold 15). Drivers by points: if/else 37 (62 pts), boolean chains 12, loops 8 (10 pts), match/switch 2 (4 pts), error handling 2 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranscriptScreen.internalGetTranscriptText (cognitive 75) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TranscriptScreen.java:347— TranscriptScreen.internalGetTranscriptText has cognitive complexity 75 (threshold 15). Drivers by points: if/else 23 (57 pts), loops 4 (11 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RealtimeProtectionService._runScheduledScan (cognitive 72) lib/services/realtime_protection_service.dart:330— RealtimeProtectionService._runScheduledScan has cognitive complexity 72 (threshold 15). Drivers by points: if/else 13 (40 pts), error handling 6 (17 pts), ternaries 2 (12 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EmulatorView.createLinks (cognitive 69) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:281— EmulatorView.createLinks has cognitive complexity 69 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 9 (23 pts), ternaries 2 (8 pts), boolean chains 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ScanScreenState._scanFiles (cognitive 68) lib/screens/scan_screen.dart:816— _ScanScreenState._scanFiles has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 5 (11 pts), boolean chains 8, error handling 2 (8 pts), ternaries 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FullUnicodeLine.setChar (cognitive 66) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:925— FullUnicodeLine.setChar has cognitive complexity 66 (threshold 15). Drivers by points: if/else 34 (51 pts), boolean chains 10, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PurchaseService._handlePurchaseUpdates (cognitive 62) lib/services/purchase_service.dart:287— PurchaseService._handlePurchaseUpdates has cognitive complexity 62 (threshold 15). Drivers by points: if/else 12 (45 pts), error handling 2 (10 pts), boolean chains 6, loops 1 (nesting depth added 41). 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.
UnicodeTranscript.blockCopy (cognitive 60) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:375— UnicodeTranscript.blockCopy has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (43 pts), loops 4 (12 pts), boolean chains 5 (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.
TermKeyListener.mapControlChar (cognitive 56) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:429— TermKeyListener.mapControlChar has cognitive complexity 56 (threshold 15). Drivers by points: if/else 31 (33 pts), boolean chains 23 (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.
_ScanScreenState._applyHeadlessEvent (cognitive 55) lib/screens/scan_ui_screen.dart:468— _ScanScreenState._applyHeadlessEvent has cognitive complexity 55 (threshold 15). Drivers by points: if/else 28 (49 pts), boolean chains 6 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemWatcherUserService.externalSnapshot (cognitive 54) android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:256— SystemWatcherUserService.externalSnapshot has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (35 pts), boolean chains 8, loops 4 (6 pts), error handling 2 (5 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.
FastAppsPlugin.onMethodCall (cognitive 53) android/app/src/main/kotlin/com/colourswift/cssecurity/MainActivity.kt:49— FastAppsPlugin.onMethodCall has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (27 pts), error handling 6 (18 pts), loops 2 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 30). 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.
_AvHomeScreenState._loadProtectionState (cognitive 48) REDACTED:465— _AvHomeScreenState._loadProtectionState has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 6 (17 pts), ternaries 3 (7 pts), boolean chains 5 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnicodeTranscript.resize (cognitive 45) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:149— UnicodeTranscript.resize has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 3 (7 pts), boolean chains 4 (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.
FullVpnController._connectInternal (cognitive 44) REDACTED:549— FullVpnController._connectInternal has cognitive complexity 44 (threshold 15). Drivers by points: if/else 26 (36 pts), boolean chains 4, error handling 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TerminalEmulator.selectGraphicRendition (cognitive 44) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:1401— TerminalEmulator.selectGraphicRendition has cognitive complexity 44 (threshold 15). Drivers by points: if/else 29 (37 pts), boolean chains 6, 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.
TermKeyListener.keyDown (cognitive 44) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:512— TermKeyListener.keyDown has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 6, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CleanerDetailScreenState.build (cognitive 43) lib/screens/scan/detail_screen.dart:200— _CleanerDetailScreenState.build has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 18 (22 pts), if/else 12 (15 pts), boolean chains 6 (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.
TerminalEmulator.updateSize (cognitive 43) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:442— TerminalEmulator.updateSize has cognitive complexity 43 (threshold 15). Drivers by points: if/else 25 (33 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AXTerminalPlugin.register (cognitive 41) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/bridge/AXTerminalPlugin.kt:33— AXTerminalPlugin.register has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (31 pts), error handling 2 (6 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 21). 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.
ScanWorker._entry (cognitive 40) lib/screens/scan_screen.dart:94— ScanWorker._entry has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 2 (8 pts), boolean chains 4, error handling 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ScanWorker._entry (cognitive 38) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:22— ScanWorker._entry has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 2 (6 pts), boolean chains 5, error handling 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanWorker._entry (cognitive 37) lib/screens/scan_ui_screen.dart:109— ScanWorker._entry has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 2 (6 pts), boolean chains 5, error handling 3 (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.
SettingsScreenState.build (cognitive 37) REDACTED:955— SettingsScreenState.build has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 15 (20 pts), if/else 13 (15 pts), boolean chains 1, match/switch 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.
CommunitySubmissionService.processManualDetections (cognitive 37) lib/services/scan api/community_submissions/community_submission_service.dart:157— CommunitySubmissionService.processManualDetections has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (22 pts), error handling 2 (6 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainActivity.configureFlutterEngine (cognitive 37) android/app/src/main/kotlin/com/colourswift/cssecurity/MainActivity.kt:296— MainActivity.configureFlutterEngine has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (24 pts), match/switch 6 (7 pts), error handling 3 (6 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
VpnConnectionController.runConnect (cognitive 37) android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/backend_port/core/VpnConnectionController.kt:320— VpnConnectionController.runConnect has cognitive complexity 37 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 4, match/switch 1 (2 pts), 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.
TranscriptScreen.drawText (cognitive 37) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TranscriptScreen.java:178— TranscriptScreen.drawText has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 7, error handling 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ScanScreenState._runRapidScan (cognitive 36) lib/screens/scan_screen.dart:571— _ScanScreenState._runRapidScan has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (27 pts), error handling 2 (6 pts), loops 1 (3 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.
_CleanerProPaneState._scanLogs (cognitive 35) lib/screens/scan/cleaner_pro_screen.dart:116— _CleanerProPaneState._scanLogs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 2 (8 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemWatcher.selectFsAttribution (cognitive 35) android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcher.kt:680— SystemWatcher.selectFsAttribution has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 10 (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.
_ScanScreenState._startScan (cognitive 33) lib/foundation.dart:35— _ScanScreenState._startScan has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (6 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.
_ScanScreenState._runSmartScan (cognitive 32) lib/screens/scan_screen.dart:410— _ScanScreenState._runSmartScan has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 6, loops 3 (4 pts), error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_FullVpnModeScreenState._connectionScreen (cognitive 32) lib/screens/vpn/full_vpn_mode_screen.dart:457— _FullVpnModeScreenState._connectionScreen has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 24, boolean chains 5, if/else 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
QuarantineService.listAll (cognitive 32) lib/services/quarantine_service.dart:299— QuarantineService.listAll has cognitive complexity 32 (threshold 15). Drivers by points: error handling 5 (12 pts), if/else 5 (11 pts), boolean chains 8, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanWorker._entry (cognitive 32) lib/services/scan_controller.dart:91— ScanWorker._entry has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (6 pts), boolean chains 4, error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanController.scanFiles (cognitive 32) lib/services/scan_controller.dart:291— ScanController.scanFiles has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RealtimeProtectionService._scanSingleFile (cognitive 30) lib/services/realtime_protection_service.dart:642— RealtimeProtectionService._scanSingleFile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 3, 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.
_ScanScreenState._runSingleAppScan (cognitive 29) lib/screens/home/scan_screen.dart:1010— _ScanScreenState._runSingleAppScan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 4, ternaries 2 (4 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.
LiteVpnController._fetchExitLocation (cognitive 29) lib/screens/vpn/lite_vpn_controller.dart:398— LiteVpnController._fetchExitLocation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, error handling 1 (2 pts), loops 1, ternaries 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.
AvHomeScreenState._startUpdate (cognitive 28) REDACTED:890— AvHomeScreenState._startUpdate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 2 (5 pts), boolean chains 4 (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.
SettingsScreenState._loadAccountInfo (cognitive 28) REDACTED:599— SettingsScreenState._loadAccountInfo has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 4 (12 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.
PaintRenderer.drawTextRun (cognitive 28) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/render/PaintRenderer.java:37— PaintRenderer.drawTextRun has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkAnalyserController.analyseApk (cognitive 27) lib/screens/apkAnalyser/apk_analyser_controller.dart:366— ApkAnalyserController.analyseApk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RealtimeProtectionService._engineCloudScan (cognitive 27) lib/services/realtime_protection_service.dart:590— RealtimeProtectionService._engineCloudScan has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 4 (8 pts), loops 1 (3 pts), boolean chains 2, ternaries 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.
_QuarantineScreenState.build (cognitive 26) lib/screens/quarantine/quarantine_screen.dart:192— _QuarantineScreenState.build has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (6 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkAnalyserBridge.extractDeepSignals (cognitive 26) REDACTED:121— ApkAnalyserBridge.extractDeepSignals has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (6 pts), boolean chains 1, error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnicodeTranscript.getLine (cognitive 26) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:604— UnicodeTranscript.getLine has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SafeWebViewScreenState._verifyAndLoad (cognitive 25) lib/screens/link checker/webview_screen.dart:68— _SafeWebViewScreenState._verifyAndLoad has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AppManagerScreenState._batchUninstall (cognitive 25) lib/screens/scan/cleaner_app_manager_screen.dart:61— _AppManagerScreenState._batchUninstall has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AlpineInstaller.extractAlpine (cognitive 25) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/bridge/alpinstaller.kt:82— AlpineInstaller.extractAlpine has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (17 pts), error handling 1 (4 pts), match/switch 1 (3 pts), loops 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.
DeviceAppsPlugin.onMethodCall (cognitive 25) plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:80— DeviceAppsPlugin.onMethodCall has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 9, match/switch 1 (nesting depth added 5). 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.
_ScanScreenState._runSingleAppScan (cognitive 24) lib/screens/scan/main_scan_ui/scan_screen.dart:1002— _ScanScreenState._runSingleAppScan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NetworkAdvancedScreenState._setCloudEnabled (cognitive 24) lib/screens/vpn/dns/NetworkProtectionScreen.dart:298— _NetworkAdvancedScreenState._setCloudEnabled has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 4 (8 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.
PurchaseService._buySubscriptionBasePlan (cognitive 24) lib/services/purchase_service.dart:187— PurchaseService._buySubscriptionBasePlan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 6, 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.
_ScanScreenState._runSingleAppScan (cognitive 23) lib/screens/scan_ui_screen.dart:1131— _ScanScreenState._runSingleAppScan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 1 (2 pts), boolean chains 1, ternaries 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.
DeviceApps.getInstalledApplications (cognitive 23) plugins/device_apps-2.2.0/lib/src/plugin.dart:19— DeviceApps.getInstalledApplications has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 2 (6 pts), loops 1 (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.
FullVpnController.fetchServerStatus (cognitive 23) REDACTED:378— FullVpnController.fetchServerStatus has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 1 (4 pts), error handling 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EmulatorView.onDraw (cognitive 22) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/view/EmulatorView.java:1555— EmulatorView.onDraw has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ScanModesScreenState._startMode (cognitive 21) lib/screens/home/scan_modes_screen.dart:47— _ScanModesScreenState._startMode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5 (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.
_CleanerLitePaneState.build (cognitive 21) lib/screens/scan/cleaner_lite_screen.dart:311— _CleanerLitePaneState.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 12, boolean chains 7, if/else 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_ScanScreenState._runSingleFileScan (cognitive 21) lib/screens/scan_ui_screen.dart:963— _ScanScreenState._runSingleFileScan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, error handling 1 (2 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_NetworkAdvancedScreenState._setCloudEnabled (cognitive 21) lib/screens/vpn/NetworkProtectionScreen.dart:318— _NetworkAdvancedScreenState._setCloudEnabled has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 2 (5 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.
QuarantineService._runLegacyMigration (cognitive 21) lib/services/quarantine_service.dart:38— QuarantineService._runLegacyMigration has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (4 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CSForegroundService.startPackageReceiver (cognitive 21) android/app/src/main/kotlin/com/colourswift/cssecurity/CSForegroundService.kt:706— CSForegroundService.startPackageReceiver has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SystemWatcherUserService.installAlpine (cognitive 21) android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:94— SystemWatcherUserService.installAlpine has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (5 pts), boolean chains 2, 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.
TerminalEmulator.emit (cognitive 21) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:1811— TerminalEmulator.emit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AppManagerScreenState.build (cognitive 20) lib/screens/scan/cleaner_app_manager_screen.dart:295— _AppManagerScreenState.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 5 (6 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
FullVpnController._postConnectRefresh (cognitive 20) REDACTED:899— FullVpnController._postConnectRefresh has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 3 (6 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.
FullVpnController._syncWithRuntime (cognitive 20) REDACTED:960— FullVpnController._syncWithRuntime has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 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.
_LinkCheckScreenState._verifyAndLoad (cognitive 19) lib/screens/link checker/link_check_screen.dart:386— _LinkCheckScreenState._verifyAndLoad has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CleanerLitePaneState._runCleaner (cognitive 19) lib/screens/scan/cleaner_lite_screen.dart:58— _CleanerLitePaneState._runCleaner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (4 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ScanScreenState._runHeadlessMultiScan (cognitive 19) lib/screens/scan_ui_screen.dart:573— _ScanScreenState._runHeadlessMultiScan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 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.
InterceptOutputStream.processByte (cognitive 19) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/bridge/PtyTermSession.kt:190— InterceptOutputStream.processByte has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 6). 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.
TerminalEmulator.process (cognitive 19) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:690— TerminalEmulator.process has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TermKeyListener.handleKeyCode (cognitive 19) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/input/TermKeyListener.java:658— TermKeyListener.handleKeyCode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LinkCheckScreenState._loadHistory (cognitive 18) lib/screens/link checker/link_check_screen.dart:74— _LinkCheckScreenState._loadHistory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CleanerLitePaneState._card (cognitive 18) lib/screens/scan/cleaner_lite_screen.dart:548— _CleanerLitePaneState._card has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 4 (5 pts), boolean chains 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.
_ScheduledScansScreenState.build (cognitive 18) lib/screens/scan/scheduled_scan_screen.dart:196— _ScheduledScansScreenState.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9, boolean chains 5, if/else 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_ScanScreenState._runSingleFileScan (cognitive 18) lib/screens/scan_screen.dart:466— _ScanScreenState._runSingleFileScan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AvFolderPickerState._load (cognitive 18) lib/widgets/av_folder_picker.dart:32— _AvFolderPickerState._load has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (5 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemWatcherUserService.recordEvent (cognitive 18) android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:441— SystemWatcherUserService.recordEvent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CSWireGuardService.withIpv6Support (cognitive 18) android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/wireguard/CSWireGuardService.kt:339— CSWireGuardService.withIpv6Support has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, 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.
TerminalEmulator.handleUTF8Sequence (cognitive 18) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:819— TerminalEmulator.handleUTF8Sequence has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnicodeTranscript.getLineColor (cognitive 18) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/UnicodeTranscript.java:682— UnicodeTranscript.getLineColor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5 (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.
AvHomeScreenState._loadProtectionState (cognitive 17) REDACTED:1114— AvHomeScreenState._loadProtectionState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (5 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ProScreenState.build (cognitive 17) lib/screens/pro/pro_screen.dart:497— _ProScreenState.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11, boolean chains 5, if/else 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PurchaseService.priceInfoForBasePlan (cognitive 17) lib/services/purchase_service.dart:477— PurchaseService.priceInfoForBasePlan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RealtimeProtectionService._scanInstalledApp (cognitive 17) lib/services/realtime_protection_service.dart:734— RealtimeProtectionService._scanInstalledApp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TerminalController._runRapidScan (cognitive 17) lib/terminal/terminal_controller.dart:446— TerminalController._runRapidScan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LinkCheckScreenState._checkLink (cognitive 16) lib/screens/link checker/link_check_screen.dart:241— _LinkCheckScreenState._checkLink has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LinkCheckScreenState._analyseTab (cognitive 16) lib/screens/link checker/link_check_screen.dart:455— _LinkCheckScreenState._analyseTab has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, ternaries 5 (6 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.
_PermissionsIntroScreenState.build (cognitive 16) REDACTED:108— _PermissionsIntroScreenState.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 5, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_CleanerLitePaneState.ensureStoragePermission (cognitive 16) lib/screens/scan/cleaner_lite_screen.dart:239— _CleanerLitePaneState.ensureStoragePermission has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 1 (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.
_FullVpnSettingsScreenState._usageAndServerPanel (cognitive 16) lib/screens/settings/full_vpn_settings_screen.dart:317— _FullVpnSettingsScreenState._usageAndServerPanel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (4 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.
TerminalController._buildCommands (cognitive 16) lib/terminal/terminal_controller.dart:160— TerminalController._buildCommands has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 2, ternaries 2, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_ConsoleScreenState._startSession (cognitive 16) lib/terminal/terminal_screen.dart:75— _ConsoleScreenState._startSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (3 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TerminalEmulator.doEscLSBQuest (cognitive 16) android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/emulator/TerminalEmulator.java:925— TerminalEmulator.doEscLSBQuest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Near-duplicate member family (4 members, 58 shared lines) · ×1
Near-duplicate member family (4 members, 58 shared lines) lib/screens/home/scan_screen.dart:1772— lib/screens/home/scan_screen.dart:1772-1907 | lib/screens/home/scan_screen.dart:1909-2197 | lib/screens/scan/main_scan_ui/scan_screen.dart:1737-1872 | lib/screens/scan/main_scan_ui/scan_screen.dart:1874-2162 — These 4 members are variants of one another: a block of 58 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 21 shared lines) · ×1
Near-duplicate member family (4 members, 21 shared lines) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:616— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:616-717 | lib/screens/vpn/AdvancedNetworkProtection_screen.dart:980-1060 | lib/screens/vpn/NetworkProtectionScreen.dart:1297-1379 | lib/screens/vpn/dns/network_live_logs_screen.dart:50-132 — These 4 members are variants of one another: a block of 21 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 68 shared lines) · ×1
Near-duplicate member family (3 members, 68 shared lines) lib/screens/home/scan_screen.dart:380— lib/screens/home/scan_screen.dart:380-493 | lib/screens/scan/main_scan_ui/scan_screen.dart:424-537 | lib/screens/scan_ui_screen.dart:573-677 — These 3 members are variants of one another: a block of 68 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 (48 shared lines) lib/screens/vpn/NetworkProtectionScreen.dart:1146— lib/screens/vpn/NetworkProtectionScreen.dart:1146-1252 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:1215-1309 — 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· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) lib/screens/home/scan_modes_screen.dart:227— lib/screens/home/scan_modes_screen.dart:227-293 | lib/screens/home/scan_screen.dart:2260-2307 | lib/screens/scan/main_scan_ui/scan_screen.dart:2225-2272 | lib/screens/scan_ui_screen.dart:1809-1866 | lib/screens/scan_ui_screen.dart:1868-1915 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (154 corresponding lines) · ×1
Edited copy of a member (154 corresponding lines) REDACTED:890— REDACTED:890-1051 | REDACTED:261-414 — These two members are one piece of code written twice and then edited apart: 154 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (87 corresponding lines) · ×1
Edited copy of a member (87 corresponding lines) REDACTED:324— REDACTED:324-410 | REDACTED:412-502 — These two members are one piece of code written twice and then edited apart: 87 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (80 corresponding lines) · ×1
Edited copy of a member (80 corresponding lines) lib/screens/vpn/NetworkProtectionScreen.dart:318— lib/screens/vpn/NetworkProtectionScreen.dart:318-397 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:298-377 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (72 corresponding lines) · ×1
Edited copy of a member (72 corresponding lines) REDACTED:282— REDACTED:282-371 | REDACTED:150-221 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (65 corresponding lines) · ×1
Edited copy of a member (65 corresponding lines) lib/screens/home/av_home_feature_row.dart:21— lib/screens/home/av_home_feature_row.dart:21-85 | lib/screens/home/av_home_primary_control.dart:28-103 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) lib/screens/vpn/services/full_vpn_location_map.dart:212— lib/screens/vpn/services/full_vpn_location_map.dart:212-267 | lib/vpn/services/full_vpn_location_map.dart:407-462 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (59 corresponding lines) · ×1
Edited copy of a member (59 corresponding lines) lib/screens/vpn/NetworkProtectionScreen.dart:796— lib/screens/vpn/NetworkProtectionScreen.dart:796-854 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:776-834 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (62 corresponding lines) · ×1
Edited copy of a member (62 corresponding lines) REDACTED:1132— REDACTED:1132-1205 | lib/screens/scan/scan_limits_screen.dart:105-166 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:566— lib/screens/vpn/services/full_vpn_backend.dart:566-613 | REDACTED:778-824 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) lib/screens/scan/detail_screen.dart:107— lib/screens/scan/detail_screen.dart:107-141 | lib/screens/scan/detail_screen.dart:143-177 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (57 corresponding lines) · ×1
Edited copy of a member (57 corresponding lines) lib/screens/home/scan_screen.dart:1269— lib/screens/home/scan_screen.dart:1269-1325 | lib/screens/scan/main_scan_ui/scan_screen.dart:1234-1290 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:868— lib/screens/vpn/services/full_vpn_backend.dart:868-910 | REDACTED:1199-1255 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) lib/screens/vpn/full_vpn_footer_nav.dart:14— lib/screens/vpn/full_vpn_footer_nav.dart:14-47 | lib/widgets/footer_nav.dart:14-49 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) REDACTED:852— REDACTED:852-888 | REDACTED:223-259 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) lib/screens/home/av_home_drawer.dart:251— lib/screens/home/av_home_drawer.dart:251-281 | lib/screens/home/av_home_drawer.dart:295-325 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×1
Edited copies of one member (3 members, 26+ corresponding lines) lib/terminal/terminal_controller.dart:419— lib/terminal/terminal_controller.dart:419-444 | lib/terminal/terminal_controller.dart:446-472 | lib/terminal/terminal_controller.dart:499-527 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 31+ corresponding lines) · ×1
Edited copies of one member (3 members, 31+ corresponding lines) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:719— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:719-749 | lib/screens/vpn/NetworkProtectionScreen.dart:856-888 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:836-874 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) lib/screens/quarantine/quarantine_screen.dart:81— lib/screens/quarantine/quarantine_screen.dart:81-114 | lib/screens/quarantine/quarantine_screen.dart:165-190 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/NetworkStats.kt:22— plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/NetworkStats.kt:22-53 | plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/NetworkStats.kt:63-91 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) lib/screens/vpn/NetworkProtectionScreen.dart:466— lib/screens/vpn/NetworkProtectionScreen.dart:466-490 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:446-470 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/UsageStats.kt:14— plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/UsageStats.kt:14-32 | plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/UsageStats.kt:56-74 | plugins/usage_stats-fixed/android/src/main/kotlin/io/github/parassharmaa/usage_stats/UsageStats.kt:76-94 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) lib/screens/scan_ui_screen.dart:355— lib/screens/scan_ui_screen.dart:355-374 | lib/services/realtime_protection_service.dart:527-551 | lib/services/realtime_protection_service.dart:553-579 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) lib/screens/scan_screen.dart:1314— lib/screens/scan_screen.dart:1314-1343 | lib/screens/scanscreen.dart:184-205 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:532— lib/screens/vpn/services/full_vpn_backend.dart:532-559 | REDACTED:740-771 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:746— lib/screens/vpn/services/full_vpn_backend.dart:746-764 | REDACTED:1070-1095 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) lib/screens/scan_screen.dart:256— lib/screens/scan_screen.dart:256-278 | lib/screens/scan_ui_screen.dart:679-707 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 10+ corresponding lines) · ×1
Edited copies of one member (6 members, 10+ corresponding lines) plugins/usage_stats-fixed/lib/usage_stats.dart:28— plugins/usage_stats-fixed/lib/usage_stats.dart:28-37 | plugins/usage_stats-fixed/lib/usage_stats.dart:39-48 | plugins/usage_stats-fixed/lib/usage_stats.dart:50-60 | plugins/usage_stats-fixed/lib/usage_stats.dart:62-72 | plugins/usage_stats-fixed/lib/usage_stats.dart:74-84 | plugins/usage_stats-fixed/lib/usage_stats.dart:86-103 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) lib/screens/vpn/services/full_vpn_backend.dart:511— lib/screens/vpn/services/full_vpn_backend.dart:511-530 | REDACTED:718-738 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:152— android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:152-167 | android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:169-191 | android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:420-435 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×1
Edited copy of a member (6 corresponding lines) lib/utils/exclusions_store.dart:110— lib/utils/exclusions_store.dart:110-115 | lib/utils/exclusions_store.dart:117-122 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×1
Edited copies of one member (3 members, 15+ corresponding lines) plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:187— plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:187-201 | plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:203-219 | plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:280-296 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×1
Edited copies of one member (4 members, 8+ corresponding lines) lib/widgets/antivirus_bridge.dart:399— lib/widgets/antivirus_bridge.dart:399-406 | lib/widgets/antivirus_bridge.dart:420-434 | lib/widgets/antivirus_bridge.dart:436-448 | lib/widgets/antivirus_bridge.dart:450-462 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×1
Edited copies of one member (3 members, 6+ corresponding lines) REDACTED:1103— REDACTED:1103-1112 | REDACTED:122-127 | lib/screens/scan_screen.dart:225-230 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) lib/screens/scan/cleaner_app_manager_screen.dart:55— lib/screens/scan/cleaner_app_manager_screen.dart:55-59 | lib/screens/scan/detail_screen.dart:103-105 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×1
Edited copies of one member (3 members, 5+ corresponding lines) lib/screens/password manager/Password_Settings_Screen.dart:35— lib/screens/password manager/Password_Settings_Screen.dart:35-42 | REDACTED:66-72 | REDACTED:204-208 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (268 lines × 2) lib/screens/home/scan_screen.dart:1909— lib/screens/home/scan_screen.dart:1909-2176 | lib/screens/scan/main_scan_ui/scan_screen.dart:1874-2141 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:1909` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (216 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:579— lib/screens/vpn/NetworkProtectionScreen.dart:579-794 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:559-774 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (177 lines × 2) lib/screens/home/scan_screen.dart:1588— lib/screens/home/scan_screen.dart:1588-1764 | lib/screens/scan/main_scan_ui/scan_screen.dart:1553-1729 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:1588` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (142 lines × 2) lib/screens/home/scan_screen.dart:237— lib/screens/home/scan_screen.dart:237-378 | lib/screens/scan/main_scan_ui/scan_screen.dart:281-422 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (114–116 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:978— lib/screens/vpn/NetworkProtectionScreen.dart:978-1093 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:974-1087 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (136 lines × 2) lib/screens/home/scan_screen.dart:1772— lib/screens/home/scan_screen.dart:1772-1907 | lib/screens/scan/main_scan_ui/scan_screen.dart:1737-1872 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (101 lines × 2) lib/screens/home/scan_screen.dart:1167— lib/screens/home/scan_screen.dart:1167-1267 | lib/screens/scan/main_scan_ui/scan_screen.dart:1132-1232 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (97 lines × 2) lib/screens/home/scan_screen.dart:869— lib/screens/home/scan_screen.dart:869-965 | lib/screens/scan/main_scan_ui/scan_screen.dart:868-964 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:869` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (96 lines × 2) REDACTED:956— REDACTED:956-1051 | REDACTED:319-414 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:956` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (88 lines × 2) lib/screens/home/scan_screen.dart:1040— lib/screens/home/scan_screen.dart:1040-1127 | lib/screens/scan/main_scan_ui/scan_screen.dart:1005-1092 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:1040` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (80 lines × 2) lib/screens/home/scan_screen.dart:1471— lib/screens/home/scan_screen.dart:1471-1550 | lib/screens/scan/main_scan_ui/scan_screen.dart:1436-1515 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (74 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:323— lib/screens/vpn/services/full_vpn_backend.dart:323-396 | REDACTED:457-530 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (65 lines × 2) lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:190— lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:190-254 | lib/screens/scan_ui_screen.dart:2112-2176 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (105 lines × 2) lib/screens/home/scan_screen.dart:380— lib/screens/home/scan_screen.dart:380-484 | lib/screens/scan/main_scan_ui/scan_screen.dart:424-528 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:380` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (53 lines × 2) lib/screens/vpn/full_vpn_footer_nav.dart:49— lib/screens/vpn/full_vpn_footer_nav.dart:49-101 | lib/widgets/footer_nav.dart:51-103 — before extracting anything, compare `lib/screens/vpn/full_vpn_footer_nav.dart` and `lib/widgets/footer_nav.dart` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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.
Duplicated block (48 lines × 3) lib/screens/home/scan_screen.dart:2260— lib/screens/home/scan_screen.dart:2260-2307 | lib/screens/scan/main_scan_ui/scan_screen.dart:2225-2272 | lib/screens/scan_ui_screen.dart:1868-1915 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (44 lines × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:801— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:801-844 | lib/screens/vpn/NetworkProtectionScreen.dart:1096-1139 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:1090-1133 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:801` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (40 lines × 2) lib/screens/home/scan_screen.dart:1286— lib/screens/home/scan_screen.dart:1286-1325 | lib/screens/scan/main_scan_ui/scan_screen.dart:1251-1290 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:1286` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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–39 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:218— lib/screens/vpn/NetworkProtectionScreen.dart:218-256 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:183-218 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/NetworkProtectionScreen.dart:218` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (37–38 lines × 2) lib/screens/scan_screen.dart:122— lib/screens/scan_screen.dart:122-159 | lib/services/scan_controller.dart:120-156 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/services/scan_controller.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_screen.dart:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (37 lines × 2) lib/screens/home/scan_screen.dart:2334— lib/screens/home/scan_screen.dart:2334-2370 | lib/screens/scan/main_scan_ui/scan_screen.dart:2299-2335 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (54 lines × 2) lib/screens/apkAnalyser/apk_analyser.dart:269— lib/screens/apkAnalyser/apk_analyser.dart:269-322 | lib/screens/apkAnalyser/apk_report_screen.dart:119-172 — 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 (83 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:1297— lib/screens/vpn/NetworkProtectionScreen.dart:1297-1379 | lib/screens/vpn/dns/network_live_logs_screen.dart:50-132 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/network_live_logs_screen.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/NetworkProtectionScreen.dart:1297` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29–31 lines × 3) lib/screens/home/scan_screen.dart:1570— lib/screens/home/scan_screen.dart:1570-1598 | lib/screens/scan/main_scan_ui/scan_screen.dart:1535-1563 | lib/screens/scan_ui_screen.dart:1419-1449 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:1570` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/home/scan_screen.dart:1566` calls `_buildScanningMain` and `lib/screens/scan_ui_screen.dart:1418` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (30 lines × 3) lib/screens/home/scan_screen.dart:1269— lib/screens/home/scan_screen.dart:1269-1298 | lib/screens/scan/main_scan_ui/scan_screen.dart:1234-1263 | lib/screens/scan_ui_screen.dart:1338-1367 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:1269` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (27–29 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:1177— lib/screens/vpn/NetworkProtectionScreen.dart:1177-1203 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:1241-1269 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/NetworkProtectionScreen.dart:1177` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (26–28 lines × 2) lib/screens/scan_screen.dart:657— lib/screens/scan_screen.dart:657-684 | lib/screens/scan_ui_screen.dart:1104-1129 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_screen.dart:657` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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) lib/screens/vpn/NetworkProtectionScreen.dart:492— lib/screens/vpn/NetworkProtectionScreen.dart:492-549 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:472-529 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (27 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:652— lib/screens/vpn/services/full_vpn_backend.dart:652-678 | REDACTED:863-889 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–26 lines × 3) REDACTED:31— REDACTED:31-56 | lib/screens/scan_screen.dart:305-330 | lib/screens/scan_ui_screen.dart:892-916 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 3) REDACTED:704— REDACTED:704-728 | lib/screens/home/scan_screen.dart:1433-1457 | lib/screens/scan/main_scan_ui/scan_screen.dart:1398-1422 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:704` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 2) lib/screens/scan/scheduled_scan_screen.dart:405— lib/screens/scan/scheduled_scan_screen.dart:405-429 | lib/screens/scan/scheduled_scan_screen.dart:472-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/scheduled_scan_screen.dart:405` it begins part-way through the construct above it, so those exact lines 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 × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:991— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:991-1036 | lib/screens/vpn/NetworkProtectionScreen.dart:1309-1354 | lib/screens/vpn/dns/network_live_logs_screen.dart:62-107 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:991` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–24 lines × 2) lib/screens/scan/scan_limits_screen.dart:220— lib/screens/scan/scan_limits_screen.dart:220-243 | lib/screens/scan/scheduled_scan_screen.dart:219-241 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/scan_limits_screen.dart:220` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:627— lib/screens/vpn/services/full_vpn_backend.dart:627-650 | REDACTED:838-861 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21–22 lines × 2) lib/screens/settings/full_vpn_settings_screen.dart:70— lib/screens/settings/full_vpn_settings_screen.dart:70-90 | lib/screens/vpn/full_vpn_mode_screen.dart:203-224 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/full_vpn_settings_screen.dart:70` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20–22 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:302— lib/screens/vpn/services/full_vpn_backend.dart:302-321 | REDACTED:434-455 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/services/full_vpn_backend.dart:302` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 3) lib/screens/home/scan_screen.dart:408— lib/screens/home/scan_screen.dart:408-428 | lib/screens/scan/main_scan_ui/scan_screen.dart:452-472 | lib/screens/scan_ui_screen.dart:597-617 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:408` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 4) lib/screens/home/scan_screen.dart:1880— lib/screens/home/scan_screen.dart:1880-1899 | lib/screens/home/scan_screen.dart:2174-2193 | lib/screens/scan/main_scan_ui/scan_screen.dart:1845-1864 | lib/screens/scan/main_scan_ui/scan_screen.dart:2139-2158 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:1880` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 3) lib/screens/apkAnalyser/apk_analyser.dart:552— lib/screens/apkAnalyser/apk_analyser.dart:552-571 | lib/screens/home/av_home_feature_row.dart:66-85 | lib/screens/home/scan_modes_screen.dart:274-293 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/apkAnalyser/apk_analyser.dart:552` it begins part-way through the construct above it, so those exact lines 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 × 3) lib/screens/home/scan_screen.dart:430— lib/screens/home/scan_screen.dart:430-449 | lib/screens/scan/main_scan_ui/scan_screen.dart:474-493 | lib/screens/scan_ui_screen.dart:618-636 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:430` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–20 lines × 3) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:61— lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:61-76 | lib/screens/scan_ui_screen.dart:146-161 | lib/services/scan_controller.dart:102-121 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 3) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:751— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:751-769 | lib/screens/vpn/NetworkProtectionScreen.dart:890-908 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:876-894 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/vpn/dns/NetworkProtectionScreen.dart:897` calls `of` and `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:772` 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–19 lines × 2) lib/screens/scan_ui_screen.dart:360— lib/screens/scan_ui_screen.dart:360-374 | lib/services/realtime_protection_service.dart:561-579 — before extracting anything, compare `lib/screens/scan_ui_screen.dart` and `lib/services/realtime_protection_service.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_ui_screen.dart:360` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 2) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:528— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:528-545 | lib/screens/vpn/AdvancedNetworkProtection_screen.dart:596-614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:528` it begins part-way through the construct above it, so those exact lines 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) lib/screens/vpn/services/full_vpn_backend.dart:886— lib/screens/vpn/services/full_vpn_backend.dart:886-904 | REDACTED:1222-1238 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/services/full_vpn_backend.dart:886` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot 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–18 lines × 3) lib/screens/home/scan_screen.dart:300— lib/screens/home/scan_screen.dart:300-312 | lib/screens/scan/main_scan_ui/scan_screen.dart:344-356 | lib/screens/scan_ui_screen.dart:508-525 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:300` it begins part-way through the construct above it, so those exact lines 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 × 4) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:657— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:657-673 | lib/screens/vpn/AdvancedNetworkProtection_screen.dart:1006-1021 | lib/screens/vpn/NetworkProtectionScreen.dart:1324-1339 | lib/screens/vpn/dns/network_live_logs_screen.dart:77-92 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:657` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16–17 lines × 3) lib/screens/home/av_home_drawer.dart:189— lib/screens/home/av_home_drawer.dart:189-204 | lib/screens/home/scan_screen.dart:1488-1504 | lib/screens/scan/main_scan_ui/scan_screen.dart:1453-1469 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/av_home_drawer.dart:189` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–17 lines × 3) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:23— lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:23-37 | lib/screens/scan_ui_screen.dart:110-124 | lib/services/scan api/headless_scan.dart:131-147 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:38` calls `free` and `lib/screens/scan_ui_screen.dart:125` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (27–29 lines × 4) lib/screens/home/scan_screen.dart:1837— lib/screens/home/scan_screen.dart:1837-1863 | lib/screens/home/scan_screen.dart:2040-2068 | lib/screens/scan/main_scan_ui/scan_screen.dart:1802-1828 | lib/screens/scan/main_scan_ui/scan_screen.dart:2005-2033 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:1837` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/home/scan_screen.dart:1836` calls `SizedBox`, `Padding` and `lib/screens/home/scan_screen.dart:2040` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15–16 lines × 2) lib/screens/scan_screen.dart:94— lib/screens/scan_screen.dart:94-108 | lib/services/scan_controller.dart:91-106 — before extracting anything, compare `lib/screens/scan_screen.dart` and `lib/services/scan_controller.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan_screen.dart:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–16 lines × 2) lib/screens/vpn/dns/NetworkProtectionScreen.dart:332— lib/screens/vpn/dns/NetworkProtectionScreen.dart:332-345 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:361-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 4) lib/screens/apkAnalyser/apk_analyser.dart:365— lib/screens/apkAnalyser/apk_analyser.dart:365-379 | lib/screens/home/scan_screen.dart:1365-1379 | lib/screens/scan/main_scan_ui/scan_screen.dart:1330-1344 | REDACTED:890-904 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/apkAnalyser/apk_analyser.dart:365` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:1222— lib/screens/vpn/NetworkProtectionScreen.dart:1222-1234 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:1284-1298 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/NetworkProtectionScreen.dart:1222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 4) lib/screens/home/scan_screen.dart:953— lib/screens/home/scan_screen.dart:953-966 | lib/screens/home/scan_screen.dart:1115-1128 | lib/screens/scan/main_scan_ui/scan_screen.dart:952-965 | lib/screens/scan/main_scan_ui/scan_screen.dart:1080-1093 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:953` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 4) lib/screens/home/scan_screen.dart:892— lib/screens/home/scan_screen.dart:892-904 | lib/screens/home/scan_screen.dart:1067-1079 | lib/screens/scan/main_scan_ui/scan_screen.dart:891-903 | lib/screens/scan/main_scan_ui/scan_screen.dart:1032-1044 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart: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.
Duplicated block (12–13 lines × 3) lib/screens/scan/scan_limits_screen.dart:116— lib/screens/scan/scan_limits_screen.dart:116-127 | lib/screens/scan/scan_limits_screen.dart:227-239 | lib/screens/scan/scheduled_scan_screen.dart:225-237 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/scan/scan_limits_screen.dart:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) lib/screens/vpn/services/full_vpn_backend.dart:290— lib/screens/vpn/services/full_vpn_backend.dart:290-300 | REDACTED:419-431 — before extracting anything, compare `lib/screens/vpn/services/full_vpn_backend.dart` and `REDACTED` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 475 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/services/full_vpn_backend.dart:290` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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–12 lines × 2) lib/screens/vpn/NetworkProtectionScreen.dart:1146— lib/screens/vpn/NetworkProtectionScreen.dart:1146-1153 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:1215-1226 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/NetworkProtectionScreen.dart:1146` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 5) lib/screens/home/scan_modes_screen.dart:229— lib/screens/home/scan_modes_screen.dart:229-239 | lib/screens/home/scan_screen.dart:2266-2276 | lib/screens/scan/main_scan_ui/scan_screen.dart:2231-2241 | lib/screens/scan_ui_screen.dart:1810-1820 | lib/screens/scan_ui_screen.dart:1874-1884 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_modes_screen.dart:229` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 5) REDACTED:676— REDACTED:676-685 | REDACTED:695-704 | REDACTED:714-723 | REDACTED:733-742 | REDACTED:752-761 — 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 `REDACTED:676` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 × 4) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:150— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:150-159 | lib/screens/vpn/AdvancedNetworkProtection_screen.dart:958-967 | lib/screens/vpn/NetworkProtectionScreen.dart:187-196 | lib/screens/vpn/NetworkProtectionScreen.dart:1275-1284 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:160` calls `_bumpUi` and `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:968` 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–10 lines × 3) REDACTED:961— REDACTED:961-969 | REDACTED:324-332 | lib/screens/link checker/link_check_screen.dart:545-554 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:961` it does not close everything it opens, so those exact lines 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) lib/screens/vpn/lite_vpn_controller.dart:238— lib/screens/vpn/lite_vpn_controller.dart:238-245 | REDACTED:905-914 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/vpn/lite_vpn_controller.dart:238` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) lib/screens/home/scan_screen.dart:766— lib/screens/home/scan_screen.dart:766-774 | REDACTED:37-45 | lib/screens/scan/main_scan_ui/scan_screen.dart:70-78 | lib/screens/scan_screen.dart:311-319 | lib/screens/scan_ui_screen.dart:896-904 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:766` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) REDACTED:234— REDACTED:234-242 | REDACTED:293-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:234` it does not close everything it opens, so those exact lines 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–8 lines × 8) lib/services/theme/theme_manager.dart:196— lib/services/theme/theme_manager.dart:196-199 | lib/services/theme/theme_manager.dart:200-207 | lib/services/theme/theme_manager.dart:208-215 | lib/services/theme/theme_manager.dart:216-223 | lib/services/theme/theme_manager.dart:224-231 | lib/services/theme/theme_manager.dart:232-234 | lib/services/theme/theme_manager.dart:237-239 | lib/services/theme/theme_manager.dart:243-245 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/theme/theme_manager.dart:196` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 3) lib/screens/home/scan_screen.dart:827— lib/screens/home/scan_screen.dart:827-834 | lib/screens/scan/main_scan_ui/scan_screen.dart:50-56 | lib/services/scan_controller.dart:237-244 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:827` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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 (5 lines × 3) lib/screens/home/scan_screen.dart:972— lib/screens/home/scan_screen.dart:972-976 | lib/screens/scan/main_scan_ui/scan_screen.dart:971-975 | lib/services/realtime_protection_service.dart:624-628 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/home/scan_screen.dart:972` it does not close everything it opens, so those exact lines 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–5 lines × 5) lib/screens/vpn/AdvancedNetworkProtection_screen.dart:648— lib/screens/vpn/AdvancedNetworkProtection_screen.dart:648-650 | lib/screens/vpn/AdvancedNetworkProtection_screen.dart:653-655 | lib/screens/vpn/AdvancedNetworkProtection_screen.dart:998-1002 | lib/screens/vpn/NetworkProtectionScreen.dart:1316-1320 | lib/screens/vpn/dns/network_live_logs_screen.dart:69-73 — before extracting anything, compare `lib/screens/vpn/AdvancedNetworkProtection_screen.dart` and `lib/screens/vpn/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:651` calls `of` and `lib/screens/vpn/AdvancedNetworkProtection_screen.dart:648` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 4) lib/screens/home/scan_screen.dart:816— lib/screens/home/scan_screen.dart:816-821 | lib/screens/scan/main_scan_ui/scan_screen.dart:831-836 | lib/screens/scan_screen.dart:381-386 | lib/screens/scan_ui_screen.dart:940-945 — before extracting anything, compare `lib/screens/home/scan_screen.dart` and `lib/screens/scan/main_scan_ui/scan_screen.dart` as WHOLE FILES: this scan already matched 80 separate duplicated blocks between them, totalling at least 2389 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 4) lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:114— lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:114-118 | lib/screens/scan_screen.dart:166-170 | lib/screens/scan_ui_screen.dart:199-203 | lib/services/scan_controller.dart:163-167 — before extracting anything, compare `lib/screens/scan/main_scan_ui/scan_isolate_worker.dart` and `lib/screens/scan_ui_screen.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 5) lib/screens/vpn/NetworkProtectionScreen.dart:309— lib/screens/vpn/NetworkProtectionScreen.dart:309-316 | lib/screens/vpn/dns/NetworkProtectionScreen.dart:289-296 | lib/screens/vpn/services/full_vpn_backend.dart:800-807 | lib/terminal/terminal_controller.dart:107-114 | REDACTED:1131-1138 — before extracting anything, compare `lib/screens/vpn/NetworkProtectionScreen.dart` and `lib/screens/vpn/dns/NetworkProtectionScreen.dart` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 934 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 5) plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:97— plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:97-102 | plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:106-111 | plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:114-119 | plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:122-127 | plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:130-135 — 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 `plugins/device_apps-2.2.0/android/src/main/java/fr/g123k/deviceapps/DeviceAppsPlugin.java:97` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated predicate lib/screens/home/scan_screen.dart:535— `!_isHeadlessMultiMode(mode) || state != ScanState.scanning` appears character-identically in 3 files — lib/screens/home/scan_screen.dart, lib/screens/scan/main_scan_ui/scan_screen.dart, lib/screens/scan_ui_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/home/scan_screen.dart:304— `!_notifProgressThrottle.isRunning || _notifProgressThrottle.elapsedMilliseconds >= 700` appears character-identically in 3 files — lib/screens/home/scan_screen.dart, lib/screens/scan/main_scan_ui/scan_screen.dart, lib/screens/scan_ui_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/home/scan_screen.dart:239— `!_uiProgressThrottle.isRunning || _uiProgressThrottle.elapsedMilliseconds >= 120` appears character-identically in 3 files — lib/screens/home/scan_screen.dart, lib/screens/scan/main_scan_ui/scan_screen.dart, lib/screens/scan_ui_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/scan/main_scan_ui/scan_isolate_worker.dart:83— `!s.startsWith('ML_Detection(') && s != 'HashMatch' && !s.startsWith('SignerMatch(')` appears character-identically in 4 files — lib/screens/scan/main_scan_ui/scan_isolate_worker.dart, lib/screens/scan_ui_screen.dart, lib/services/scan api/headless_scan.dart, lib/services/scan_controller.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/vpn/NetworkProtectionScreen.dart:992— `(cloudEnabled || _devForceFree) && effectivePlan != 'pro'` appears character-identically in 2 files — lib/screens/vpn/NetworkProtectionScreen.dart, lib/screens/vpn/dns/NetworkProtectionScreen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/vpn/NetworkProtectionScreen.dart:1065— `(resetLine.isNotEmpty || lastLine.isNotEmpty) && cloudEnabled` appears character-identically in 2 files — lib/screens/vpn/NetworkProtectionScreen.dart, lib/screens/vpn/dns/NetworkProtectionScreen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/vpn/services/full_vpn_location_map.dart:142— `_fromCenter == null || _toCenter == null` appears character-identically in 2 files — lib/screens/vpn/services/full_vpn_location_map.dart, lib/vpn/services/full_vpn_location_map.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/vpn/services/full_vpn_location_map.dart:360— `_hasIpPoint && sel != null && (widget.isConnecting || widget.connected)` appears character-identically in 2 files — lib/screens/vpn/services/full_vpn_location_map.dart, lib/vpn/services/full_vpn_location_map.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/home/scan_screen.dart:512— `_session.isScanning || _session.cancelling` appears character-identically in 3 files — lib/screens/home/scan_screen.dart, lib/screens/scan/main_scan_ui/scan_screen.dart, lib/screens/scan_ui_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart:45— `a.name.toLowerCase().contains(_query) || a.package.toLowerCase().contains(_query)` appears character-identically in 2 files — lib/screens/scan/main_scan_ui/scan_installed_app_sheet.dart, lib/screens/scan_ui_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/vpn/services/full_vpn_backend.dart:458— `assignedIp.isEmpty || endpoint.isEmpty || serverPublicKey.isEmpty || allowed.isEmpty` appears character-identically in 2 files — lib/screens/vpn/services/full_vpn_backend.dart, 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 lib/screens/apkAnalyser/apk_analyser_controller.dart:241— `cachedBillingPro || (cachedServerSignedIn && cachedServerPro)` appears character-identically in 2 files — lib/screens/apkAnalyser/apk_analyser_controller.dart, 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 lib/screens/vpn/AdvancedNetworkProtection_screen.dart:43— `decision != null && decision['match'] is Map` appears character-identically in 3 files — lib/screens/vpn/AdvancedNetworkProtection_screen.dart, lib/screens/vpn/NetworkProtectionScreen.dart, lib/screens/vpn/dns/network_protection_models.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/scan/main_scan_ui/scan_log_listener.dart:41— `decoded is Map && decoded['event'] == 'entry_progress'` appears character-identically in 2 files — lib/screens/scan/main_scan_ui/scan_log_listener.dart, lib/widgets/scan_log_listener.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/vpn/AdvancedNetworkProtection_screen.dart:656— `e.matchList != null && e.matchType != null` appears character-identically in 3 files — lib/screens/vpn/AdvancedNetworkProtection_screen.dart, lib/screens/vpn/NetworkProtectionScreen.dart, lib/screens/vpn/dns/network_live_logs_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/home/scan_screen.dart:293— `e.type == 'current' || e.type == 'progress'` appears character-identically in 3 files — lib/screens/home/scan_screen.dart, lib/screens/scan/main_scan_ui/scan_screen.dart, lib/screens/scan_ui_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/home/scan_screen.dart:275— `e.type == 'enumerated' || e.type == 'empty'` appears character-identically in 3 files — lib/screens/home/scan_screen.dart, lib/screens/scan/main_scan_ui/scan_screen.dart, lib/screens/scan_ui_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/vpn/AdvancedNetworkProtection_screen.dart:654— `e.upstream != null && e.upstream!.trim().isNotEmpty` appears character-identically in 3 files — lib/screens/vpn/AdvancedNetworkProtection_screen.dart, lib/screens/vpn/NetworkProtectionScreen.dart, lib/screens/vpn/dns/network_live_logs_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/vpn/AdvancedNetworkProtection_screen.dart:208— `existing != null && existing.trim().isNotEmpty` appears character-identically in 3 files — lib/screens/vpn/AdvancedNetworkProtection_screen.dart, lib/screens/vpn/NetworkProtectionScreen.dart, lib/screens/vpn/dns/NetworkProtectionScreen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/vpn/services/full_vpn_backend.dart:373— `firstLoad || changed || prevSync != _usageSyncing` appears character-identically in 2 files — lib/screens/vpn/services/full_vpn_backend.dart, 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 lib/screens/home/scan_screen.dart:1414— `lower.contains('vxgen2') || lower.contains('muniverse')` appears character-identically in 2 files — lib/screens/home/scan_screen.dart, lib/screens/scan/main_scan_ui/scan_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/home/scan_screen.dart:176— `m == ScanMode.smart || m == ScanMode.rapid || m == ScanMode.installed || m == ScanMode.full || m == ScanMode.custom` appears character-identically in 2 files — lib/screens/home/scan_screen.dart, lib/screens/scan/main_scan_ui/scan_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/scan/main_scan_ui/scan_log_listener.dart:23— `msg is Map && msg['path'] is String && msg['entry'] is String` appears character-identically in 2 files — lib/screens/scan/main_scan_ui/scan_log_listener.dart, lib/widgets/scan_log_listener.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/screens/vpn/services/full_vpn_backend.dart:362— `nextUsed != _usedBytes || nextLimit != _limitBytes || nextUnlimited != _unlimited` appears character-identically in 2 files — lib/screens/vpn/services/full_vpn_backend.dart, 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 lib/screens/home/scan_screen.dart:860— `pickedPath == null || pickedPath.isEmpty` appears character-identically in 3 files — lib/screens/home/scan_screen.dart, lib/screens/scan/main_scan_ui/scan_screen.dart, lib/screens/scan_ui_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Silent fallback default in catch android/app/src/main/kotlin/com/colourswift/cssecurity/DeviceSecurityBridge.kt:220— `getGlobalInt` 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 android/app/src/main/kotlin/com/colourswift/cssecurity/DeviceSecurityBridge.kt:228— `getSecureInt` 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 REDACTED:245— `loadAppName` 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 android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt:415— `shExit` 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 android/app/src/main/kotlin/com/colourswift/cssecurity/vpn/wireguard/CSWireGuardService.kt:312— `parseExcludedApps` 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 lib/screens/home/scan_screen.dart:834— `_getUserInstalledApps` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/screens/scan/cleaner_lite_screen.dart:291— `_scanUnusedApps` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/screens/scan_screen.dart:405— `_getUserInstalledApps` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/screens/scan_ui_screen.dart:958— `_getUserInstalledApps` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/services/av_engine.dart:47— `_init` turns every thrown error into `-1` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/services/scan_controller.dart:244— `getUserInstalledApps` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/terminal/sys_info.dart:11— `uname` turns every thrown error into `'unknown'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/terminal/sys_info.dart:27— `uptime` turns every thrown error into `'unknown'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/terminal/sys_info.dart:38— `cpu` turns every thrown error into `'unknown'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/terminal/sys_info.dart:49— `mem` turns every thrown error into `'unknown'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/terminal/sys_info.dart:59— `disk` turns every thrown error into `'unknown'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/terminal/sys_info.dart:69— `network` turns every thrown error into `'unknown'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/terminal/sys_info.dart:80— `battery` turns every thrown error into `'unknown'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch lib/terminal/terminal_controller.dart:360— `_getTotalRam` turns every thrown error into `'unknown'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
Fat interface: AppLocalizations (1218 abstract methods) lib/translations/app_localizations.dart:18— `AppLocalizations` declares 1218 abstract methods: `appName`, `ok`, `cancel`, `footerHome`, `footerExplore`, `footerRemoved`, `footerSettings`, `proBadge`, `updateDbTitle`, `updateDbVersionLabel`, `companionAppsSectionTitle`, `cleanerReclaimableLabel`, `exploreMultiThreadingTitle`, `exploreMultiThreadingSubtitle`, `updateDbAutoDownloadLabel`, `updateDbUpdatedAutoOn`, `updateDbUpdatedSuccess`, `updateDbUpdateFailed`, `engineReadyBanner`, `scanButton`, `scanModeFullTitle`, `scanModeFullSubtitle`, `scanModeSmartTitle`, `scanModeSmartSubtitle`, `scanModeRapidTitle`, `scanModeRapidSubtitle`, `scanModeInstalledTitle`, `scanModeInstalledSubtitle`, `scanModeSingleTitle`, `scanModeSingleSubtitle`, `scanModeCustomTitle`, `scanModeCustomSubtitle`, `customScanChooseSubtitle`, `customChoiceFolder`, `customChoiceFolderSubtitle`, `customChoiceSdCard`, `customChoiceSdCardSubtitle`, `customChoiceFileSubtitle`, `customChoiceExclusionsSubtitle`, `useCloudAssistedScan`, and 1178 more. Counted over its public methods with no body, once per name; concrete methods and `_`-private members are not counted, because no implementer that extends it is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Documentation: no build, run or usage example README.md:1— the repository is a Flutter application (`lib/main.dart`) and neither `README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
No ADRs found lib/main.dart:68— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `lib/main.dart` makes this repository a deployable product (line 68).
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation· No architecture diagram/doc · ×1
No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
No SAST — No static application security testing detected. For this repository's stack, add `semgrep --config=auto` plus gitleaks for committed secrets — this tree has no MSBuild project file, so CodeQL's csharp pack (which traces a build) and NuGet security analyzers (which are referenced from a project) have nothing to attach to — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No dependency-update automation android/app/build.gradle.kts:97— `android/app/build.gradle.kts` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
Nullable reference types not enabled everywhere — 0/1 C# file(s) are in a nullable-enabled context. This repository commits no project file, so nothing sets <Nullable>enable</Nullable> for it: a file is enabled only by its own `#nullable enable`, by a Unity `csc.rsp` with `-nullable:enable` for its assembly, or as a file-based app (`#:` directives) whose `#:property Nullable` does not turn it off. NRTs catch a whole class of null-deref bugs at compile time.
Silent fallback default on Err android/app/src/main/jniLibs/trimmed_Engine.rs:593— `av_scan_inner` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 3 file(s) — `android/app/build.gradle.kts`, `android/app/src/main/kotlin/com/colourswift/cssecurity/rtp/SystemWatcherUserService.kt`, `android/app/src/main/kotlin/com/colourswift/cssecurity/terminal/bridge/alpinstaller.kt` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
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 01a1e95f-e892-70ca-831e-5521681ec683 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 7 · Warnings: 763 · Recommendations: 68 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 11:58 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.