Public report of ManuXD32/AI-Doomsday-Toolbox, 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 report Measured 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, 17:21 UTC · Survey ID cd_1c543478425f475fa01d0d850c78049e

ManuXD32/AI-Doomsday-Toolbox

Measured 17 November 2026, 17:17 UTC, at code version 007c523

First survey, so nothing to compare with yet Knowledge freshness: not measured

Knowledge freshness is not measured: History too condensed to judge knowledge freshness.

CAI score 52.6out of 100 Adequate
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 very large codebase: 512,692 lines of product code in 25 projects, tests not counted · Estimated rebuild effort: about 4.7 person-years · Weakest lens: Production Readiness, 47.8

Findings by how serious they are

15 critical 3336 serious 86 minor

15 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

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 17:17 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 ▸

64of 64 dimensions measured by tools.
3427of 3437 findings point to an exact file and line, so you can open each one in the code. The other 10 concern the repository as a whole, such as missing documentation.
64dimensions across 8 lenses, read from 512,692 lines of product code in 25 projects.
Chapters

Executive summary

ManuXD32/AI-Doomsday-Toolbox falls short of our standard for a preview release, held back most by its Production Readiness lens, the way the code is tested, built, released and run. It scores 52.6 out of 100 and is rated Adequate, and all 15 of its critical findings are security problems in the build pipeline.

Production Readiness, at 47.8, is the weakest lens and counts most in the score. The best first step is protecting outgoing calls with timeouts, worth about 3.4 points. Documenting the recovery plan comes next, worth about 3.0 points. Raising Production Readiness to 62 would lift the score to about 56.5.

Fifteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Pinning each tool to an exact version would close this risk.

The product code is 512,692 lines, about €680,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 for The 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.
Production Readiness 47.8 · counts for 45%Domain Modelling 54.3 · counts for 25%Accessibility 54.5 · counts for 14%Performance 60.0 · counts for 8%Security and Compliance 60.9 · counts for 4%Code Health 62.1 · counts for 2%Maturity 65.0 · counts for 1%Architecture 91.2 · counts for 1%

If Production Readiness rose from 47.8 to 62, the lowest score rated Strong, the score would rise from 52.6 to about 56.5.

Code composition: what the lines of code are
Product code 83%Tests 17%
Rebuild cost: about €680,000 · Estimate
Cost to rebuild€230,000 to €1,100,000, for 3,789 to 12,020 hours of work, about 4.7 person-years for 2 to 9 engineers
Difficulty of the problemStandard, 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 53. 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.
SizeVery large: 512,692 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
Raises the score by about 3.4 points · Medium effort · Outbound HTTP resilience
2
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Raises the score by about 3.0 points · Medium effort · DR & Backup
3
Keep a changelog (e.g.
Keep-a-Changelog) recording what shipped in each release.
Raises the score by about 2.3 points · Medium effort · Release Hygiene

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €680,000 to build again, about 4.7 person-years of work. Its weakest lens is Production Readiness, at 47.8 (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
Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry). Of all the actions in this report, it raises the score most for the work it takes: about 3.4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 574,876 lines over the last 90 days, which is about 2,331,442 lines a year. At that pace, the extra work comes to an estimated 325.8 to 1955 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.

arch :app :app :wear-protocol :wear-protocol :app->:wear-protocol :asset_debian :asset_debian :feature_kiwix_armv9 :feature_kiwix_armv9 :feature_kiwix_armv9->:app :feature_kiwix_baseline :feature_kiwix_baseline :feature_kiwix_baseline->:app :feature_kiwix_dotprod :feature_kiwix_dotprod :feature_kiwix_dotprod->:app :feature_llm_armv9 :feature_llm_armv9 :feature_llm_armv9->:app :feature_llm_baseline :feature_llm_baseline :feature_llm_baseline->:app :feature_llm_dotprod :feature_llm_dotprod :feature_llm_dotprod->:app :feature_llm_i8mm :feature_llm_i8mm :feature_llm_i8mm->:app :feature_llm_snapdragon_hexagon_core :feature_llm_snapdragon_hexagon_core :feature_llm_snapdragon_hexagon_core->:app :feature_llm_snapdragon_opencl :feature_llm_snapdragon_opencl :feature_llm_snapdragon_opencl->:app :feature_media_armv9 :feature_media_armv9 :feature_media_armv9->:app :feature_media_baseline :feature_media_baseline :feature_media_baseline->:app :feature_media_dotprod :feature_media_dotprod :feature_media_dotprod->:app :feature_media_i8mm :feature_media_i8mm :feature_media_i8mm->:app :feature_media_snapdragon_opencl :feature_media_snapdragon_opencl :feature_media_snapdragon_opencl->:app :feature_media_snapdragon_vulkan :feature_media_snapdragon_vulkan :feature_media_snapdragon_vulkan->:app :feature_upscaler :feature_upscaler :feature_upscaler->:app :wear :wear :wear->:wear-protocol __more__ +5 more projects

At a glance — Code Health · 62.1 · Adequate · gated by D2 ·

At a glance — Architecture · 91.2 · Exemplary ·

At a glance — Maturity · 65.0 · Adequate · gated by M2 ·

At a glance — Readiness · 47.8 · Adequate · gated by P7 ·

At a glance — Security · 60.9 · Adequate · gated by D29, D36, C1 ·

At a glance — Domain Modelling · 54.3 · Adequate · gated by DM4, DM11 ·

At a glance — Accessibility · 54.5 · Adequate · gated by AC6 ·

At a glance — Performance · 60.0 · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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 categoryFindingsSeverity
A05:2025 — Injection33High / Critical
A03:2025 — Software Supply Chain Failures4Medium

Roadmap

Top priorities: Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry); Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery); Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).+3.4 ptsMediumOutbound HTTP resilience
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).+3.0 ptsMediumDR & Backup
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+2.3 ptsMediumRelease Hygiene
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.+1.4 ptsMediumObservability
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+1.2 ptsMediumVisual & motion safety
Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.+1.1 ptsMediumRich vs anemic model
Give each aggregate one way in that can refuse — a guarded constructor, value-object parameters that validate themselves, or a private constructor behind a factory that returns a failure.+1.1 ptsMediumConstructible invalid state
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+1.0 ptsMediumPage structure

File quality

Per-file score 0–10 — a quality signature. Of 612 files carrying findings, judged against the Preview bar: 0% slop · 3% mixed · 97% near-clean.

FileScoreBandWorst signal
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
app/src/main/java/com/example/llamadroid/service/AgentService.kt5.5MixedCyclomatic Complexity: AgentService.executeToolCall (cyclomatic 323)
app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt5.5MixedCyclomatic Complexity: TamaGameEngine.restoreTransferBundle (cyclomatic 24)
app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt5.5MixedCyclomatic Complexity: LiteRtLmReflectionBridge.generateStreaming (cyclomatic 20)
app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt5.5MixedGod Classes: FileTooLong: service/RemoteSummaryClient.kt
REDACTED5.8MixedStatic Analysis (SAST): Medium: REDACTED
app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt6.0MixedExplicit Debt: TodoComment
REDACTED6.4MixedStatic Analysis (SAST): Medium: REDACTED
app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt6.5MixedCyclomatic Complexity: SDModelsScreenKt.InstalledSDModelsTab (cyclomatic 91)
app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt6.5MixedCyclomatic Complexity: ModelRepository.getModelDir (cyclomatic 42)
app/src/main/java/com/example/llamadroid/service/PDFService.kt6.5MixedCyclomatic Complexity: PDFService.recognizeBitmapWithLlamaOcr (cyclomatic 40)
app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt6.5MixedGod Classes: ClassTooLong: DatasetProcessor
REDACTED6.9MixedStatic Analysis (SAST): Medium: REDACTED
app/src/main/java/com/example/llamadroid/data/model/LocalModelImports.kt6.9MixedCognitive Complexity: LocalModelImportsKt.importSDModel (cognitive 18)
app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt7.0Near-cleanCyclomatic Complexity: ImageGenScreenKt.ImageGenScreen (cyclomatic 475)
app/src/main/java/com/example/llamadroid/service/LlamaService.kt7.0Near-cleanCyclomatic Complexity: LlamaService.startServer (cyclomatic 257)
app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt7.0Near-cleanCyclomatic Complexity: MasterModeScreenKt.MasterModeScreen (cyclomatic 239)
app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt7.0Near-cleanCyclomatic Complexity: NativeHarnessController.dispatchInternal (cyclomatic 150)

How the grades work

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 — 15

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 — 3336

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 — 86

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 15

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 64 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, the weighted average across measured dimensions.

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 64 dimensions across the health lenses
D1D2D3D4D5D6D13D14D15D17D19D20D21D26D27D28D29D35D36D44AC2AC3AC6AX10AX3AX4AX6C1C4DM10DM11DM4DM5DM9M1M2M3M4P1P2P3P5P6P7PF3X1X12X13X14X15X16X17X18X19X2X21X25X26X27X28X29X3X30X5

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
  1. 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, 3427 of 3437 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.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. 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.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1ea83-1465-75eb-8c73-85670f535563.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .py, .kt, and our analyzer cannot run the .kt test suite(s) — so no coverage was collected for the repository as a whole. The Python half did build and run, and its own line coverage came back at 88.4% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.kt) and this repository declares a JVM test suite (repository root, Gradle), but it was not re-run: the analyzer environment could not run it. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — a Gradle build resolved 420 artifact(s) across its subprojects (165 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • 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 100 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 — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • 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.
  • D34 Knowledge Freshness — git history too condensed for a reliable signal — The history looks squashed or freshly imported, so per-file ownership reflects those commits rather than real maintenance. This dimension is reported as a low-confidence advisory and is not scored.
  • AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in app/src/main/java/com/example/llamadroid/harness/HarnessInstallationFiles.kt, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Boot via AndroidApp (app). the Android app did not build — `./gradlew :app:assembleDebug` exited 1: ct :app > Could not resolve com.termux.termux-app:terminal-view:0.118.0. > Could not get resource 'https://jitpack.io/com/termux/termux-app/terminal-view/0.118.0/terminal-view-0.118.0.p…; runtime evidence skipped (launch chosen because app/build.gradle.kts applies the Android application plugin and gradlew builds it).
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • DM11 Constructible invalid state — 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. 64 further occurrence(s) are not listed individually; the score already reflects all 104.
  • DM8 Value-object opportunities — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds primitive parameters that travel together through several signatures of the domain (a missing value object). Its deterministic rule has not yet shown 95 % precision on adjudicated rows, so the clumps it finds are counted here and not published as findings, and the card carries no score. That is a limit of the analyzer, not a finding about your code.
  • DM9 Scattered domain decisions — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The frontend declares that it computes whether a construction is produced or passed, yet 11552 of 11552 constructions arrived without the answer. Arm two skipped them; it did not clear them.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Kotlin, Python, c, cpp is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Kotlin, Python, c, cpp is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 181 further occurrence(s) are not listed individually; the score already reflects all 221.
  • X7 Silent fallback defaults — 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. 32 further occurrence(s) are not listed individually; the score already reflects all 72.

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.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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.
  • C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
  • DM4 Rich vs anemic model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity4.1 / 10Weak✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 4.1 / 10 · rule-coverage 100% · ceiling Prevented

450 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ImageGenScreenKt.ImageGenScreen at 475. A further 67 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 NativeHarnessNoticeKt.localizedHarnessNoticeMessage at 109 — they are counted neither in the figure above nor in this dimension's score. 21 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessNotice.kt (NativeHarnessNoticeKt.localizedHarnessNoticeMessage at 109), app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt (WearRequestRouter.route at 66), app/src/main/java/com/example/llamadroid/ui/walkthrough/WalkthroughPreviews.kt (WalkthroughPreviewsKt.lessonPreviewResource at 61), app/src/main/java/com/example/llamadroid/data/model/ModelLibraryManager.kt (ModelLibraryManager.relativeDirFor at 37), app/src/main/java/com/example/llamadroid/tama/data/PetSpeciesLine.kt (PetSpeciesLineKt.mapPetActionToSpriteState at 36), and 16 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

ImageGenScreenKt.ImageGenScreen (cyclomatic 475)app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:140
AgentService.executeToolCall (cyclomatic 323)app/src/main/java/com/example/llamadroid/service/AgentService.kt:11014
AgentService.sendMessage (cyclomatic 317)app/src/main/java/com/example/llamadroid/service/AgentService.kt:8199
LlamaService.startServer (cyclomatic 257)app/src/main/java/com/example/llamadroid/service/LlamaService.kt:585
MasterModeScreenKt.MasterModeScreen (cyclomatic 239)app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:121

+ 445 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 4 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with ImageGenScreenKt.ImageGenScreen (cyclomatic 475), AgentService.executeToolCall (cyclomatic 323), AgentService.sendMessage (cyclomatic 317). — 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 4 together lifts Cyclomatic Complexity from 4.1 to about 4.8/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

642 method(s) exceeded the cognitive complexity threshold of 15; the worst was ImageGenScreenKt.ImageGenScreen at 738.

ImageGenScreenKt.ImageGenScreen (cognitive 738)app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:140
AgentService.sendMessage (cognitive 511)app/src/main/java/com/example/llamadroid/service/AgentService.kt:8199
AgentService.executeToolCall (cognitive 467)app/src/main/java/com/example/llamadroid/service/AgentService.kt:11014
LlamaService.startServer (cognitive 403)app/src/main/java/com/example/llamadroid/service/LlamaService.kt:585
MasterModeScreenKt.RemoteMasterCard (cognitive 359)app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3845

+ 637 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 6 bodies over 240 down to 240 or less in Cognitive Complexity — start with ImageGenScreenKt.ImageGenScreen (cognitive 738), AgentService.sendMessage (cognitive 511), AgentService.executeToolCall (cognitive 467). — 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 6 together lifts Cognitive Complexity from 2.0 to about 3.5/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes7.2 / 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.

Maturity: Documented → Verified → Prevented · effective 7.2 / 10 · rule-coverage 100% · ceiling Prevented

597 god class(es) detected.

MethodTooLong: ImageGenScreenKt.ImageGenScreen · ×270app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:140
FileTooLong: service/AgentService.kt · ×183app/src/main/java/com/example/llamadroid/service/AgentService.kt
ClassTooLong: AgentService · ×72app/src/main/java/com/example/llamadroid/service/AgentService.kt:301
TooManyMethods: SettingsRepository · ×72app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:188

What to do

  1. Resolve the 270 MethodTooLong finding(s) in God Classes — start with AgentService.kt (12), TamaScreen.kt (8), NotesManagerScreen.kt (5). — One of this dimension's main actionable groups (270 warning-level).
  2. Resolve the 183 FileTooLong finding(s) in God Classes — start with AgentService.kt, PDFService.kt, WorkflowsScreen.kt. — One of this dimension's main actionable groups (183 warning-level).
  3. Resolve the 72 ClassTooLong finding(s) in God Classes — start with NativeChatTools.kt (2), KnowledgeBaseRepository.kt (2), AgentService.kt. — One of this dimension's main actionable groups (72 warning-level).

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication7.2 / 10Strong✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

Maturity: Documented → Verified → Prevented · effective 7.2 / 10 · rule-coverage 100% · ceiling Verified

876 duplicated block group(s) detected. 7.1 % of the production lines (36,483 of 512,692) are in a reported copy. A further 490 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (8 lines × 2) · ×71app/src/main/java/com/example/llamadroid/data/db/RestoreCoordinator.kt:596
Duplicated block (9 lines × 2) · ×53app/src/main/java/com/example/llamadroid/audio/music/StableAudio3ModelDoctor.kt:394
Duplicated block (12 lines × 2) · ×44app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:489
Duplicated block (7 lines × 2) · ×44app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:746
Duplicated block (6 lines × 2) · ×43app/src/main/java/com/example/llamadroid/onnx/OnnxBackgroundRemovalSupport.kt:550

+ 308 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 71 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with StableDiffusionService.kt (4), PDFService.kt (3), WorkflowsScreen.kt (3). — One of this dimension's main actionable groups (71 warning-level).
  2. Resolve the 53 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with AgentDialogs.kt (4), PDFService.kt (3), StableDiffusionService.kt (3). — One of this dimension's main actionable groups (53 warning-level).
  3. Resolve the 44 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with AgentService.kt (3), MediaTranslationWorkflowService.kt (2), StableDiffusionService.kt (2). — One of this dimension's main actionable groups (44 warning-level).

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling9.4 / 10Stronggated by 2 serious findings✓ 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.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Prevented

25 production modules (Gradle+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 4 of the 25 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: :wear-protocol · ×2

What to do

  1. 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.

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 5 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

5 of 405 classes have LCOM4 above 3.

Low cohesion: AgentService (LCOM4 6) · ×5app/src/main/java/com/example/llamadroid/service/AgentService.kt:301

What to do

  1. Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with AgentService.kt, RemoteSummaryClient.kt, LiteRtLmChatService.kt. — One of this dimension's main actionable groups (5 warning-level).

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 33 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 23 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure. 8 further coordinate(s) are declared with no version at the declaration site — inherited from a parent POM, a BOM or an unresolved Gradle version reference — and are NOT graded: this verdict covers what the checkout pins, not the full transitive graph. A further 34 coordinate(s) are not published to Maven Central — another repository (Google's Maven hosts androidx), a SNAPSHOT, or a private artifact — so their licences are not readable from here and they are outside this verdict.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots8.7 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.7 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt (20×475=9500); app/src/main/java/com/example/llamadroid/service/AgentService.kt (20×323=6460); app/src/main/java/com/example/llamadroid/service/LlamaService.kt (10×257=2570) Repeated repair below the complexity floor: app/src/main/java/com/example/llamadroid/data/model/DownloadTaskSupport.kt (4 of 5 changes were fixes); app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCatalog.kt (4 of 4 changes were fixes); app/src/main/java/com/example/llamadroid/service/NativeChatKvCacheCoordinator.kt (3 of 4 changes were fixes)

Hotspot: app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt · ×120app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:140
Repeated repair: app/src/main/java/com/example/llamadroid/data/model/DownloadTaskSupport.kt · ×6app/src/main/java/com/example/llamadroid/data/model/DownloadTaskSupport.kt:139

What to do

  1. Resolve the 120 Hotspot finding(s) in Churn × Complexity Hotspots — start with ImageGenScreen.kt, AgentService.kt, LlamaService.kt. — One of this dimension's main actionable groups (120 warning-level).
  2. Resolve the 6 Repeated repair finding(s) in Churn × Complexity Hotspots — start with DownloadTaskSupport.kt, NativeHarnessCatalog.kt, NativeChatKvCacheCoordinator.kt. — One of this dimension's main actionable groups (6 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt10.0 / 10Stronggated by 1 serious finding✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

1 deducted task-comment markers across 512692 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.

TodoCommentapp/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:1808

What to do

  1. Resolve the 1 TodoComment finding(s) in Explicit Debt — start with AgentProjectControlPlane.kt. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

2 of 2 documentation facets pass in full. 3 document(s) read across 22 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs foundwear/build.gradle.kts:2

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.kts. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming Consistency8.7 / 10Strong✓ Tool-verified

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

Maturity: Documented → Verified → Prevented · effective 8.7 / 10 · rule-coverage 100% · ceiling Verified

7 naming inconsistencies among 544 declarations measured against a convention their peers follow.

`importSDModel` spells `SD` where 292 names in the project spell it `Sd`app/src/main/java/com/example/llamadroid/data/model/LocalModelImports.kt:22
`getLLMModels` spells `LLM` where 57 names in the project spell it `Llm`app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:155
`callLLM` spells `LLM` where 57 names in the project spell it `Llm`app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:576
`performOCR` spells `OCR` where 188 names in the project spell it `Ocr`app/src/main/java/com/example/llamadroid/service/PDFService.kt:7599
`startSDServer` spells `SD` where 292 names in the project spell it `Sd`app/src/main/java/com/example/llamadroid/service/SDEnvironmentService.kt:230

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 `importSDModel` spells `SD` where 292 names in the project spell it `Sd` finding(s) in Naming Consistency — start with LocalModelImports.kt. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `getLLMModels` spells `LLM` where 57 names in the project spell it `Llm` finding(s) in Naming Consistency — start with ModelRepository.kt. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `callLLM` spells `LLM` where 57 names in the project spell it `Llm` finding(s) in Naming Consistency — start with DatasetProcessor.kt. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.

D26 · Project Cohesion5.0 / 10Adequate✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic.

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 4 build units (Gradle) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesionapp/build.gradle.kts:1

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with build.gradle.kts. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D27 · Navigability9.3 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Documented

33 % of calls cross a namespace and 13 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)3.9 / 10Weak✓ Tool-verified

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).

Maturity: Documented → Verified → Prevented · effective 3.9 / 10 · rule-coverage 100% · ceiling Documented

33 finding(s): 0 critical, 15 high, 18 medium, 0 low. 15 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 12 file(s) — `app/src/main/cpp/terminal/termux.c` (line 114, line 172, line 178, …), `app/src/main/java/com/example/llamadroid/data/db/DatabaseBackupManager.kt` (line 91, line 299), `app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt`, `app/src/main/java/com/example/llamadroid/harness/HarnessCredentialStore.kt` (line 156), `app/src/main/java/com/example/llamadroid/harness/HarnessSessionDeletion.kt` (line 102), … (+7 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 17 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (17). — One of this dimension's main actionable groups (17 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. No action in Static Analysis (SAST) — all 15 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (15 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 2.5 / 10 · rule-coverage 100% · ceiling Documented

1/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 3 platform declaration(s) and 68 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.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC3 · Page structure5.7 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — privacy-policy.html:2

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC6 · Visual & motion safety2.7 / 10Weak✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • `.main` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — app/src/main/assets/file_station_webui/css/app.css:67
  • `.upload-progress div` moves (`transition: width 160ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — app/src/main/assets/ai_servers_webui/styles.css:257
  • `.progress-track div` moves (`transition: width 220ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — app/src/main/assets/ai_servers_webui/styles.css:432
  • `.hub-server-card` moves (`transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — app/src/main/assets/ai_servers_webui/styles.css:527

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX10 · Code composition9.0 / 10Exemplary✓ Tool-verified

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.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

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.

AX6 · Interface segregation9.4 / 10Exemplary✓ Tool-verified

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.

  • `AudioDao` declares 23 abstract methods: `observeVoiceProfiles`, `getVoiceProfiles`, `getVoiceProfile`, `insertVoiceProfile`, `updateVoiceProfile`, `deleteVoiceProfile`, `observeJobs`, `observeUiJobs`, `observeJob`, `observeHistory`, `getJob`, `getClaimedJobs`, `getNextQueuedJob`, `claimQueuedJob`, `insertJob`, `updateJob`, `deleteJob`, `markRecoverableJobsInterrupted`, `requeueJob`, `markCancelling`, `cancelQueuedJob`, `getActiveJob`, `getJobsForVoice`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/audio/AudioEntities.kt:203
  • `AudioLibraryDao` declares 27 abstract methods: `observeItemsPage`, `observeItemCount`, `matchingItemIds`, `getItem`, `getItems`, `getItemsInFolders`, `observeAllItems`, `getItemsByOriginKeys`, `insertItems`, `insertItem`, `updateItem`, `moveItems`, `renameItem`, `deleteItem`, `observeFolders`, `getFolders`, `getFolder`, `observeChildFolders`, `findFolderByName`, `insertFolder`, `updateFolder`, `deleteFolder`, `countChildFolders`, `countItemsInFolder`, `getPreferences`, `observePreferences`, `upsertPreferences`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryEntities.kt:73
  • `LlamaChatDao` declares 23 abstract methods: `getAllChats`, `getEasyChats`, `getPinnedAiHubChats`, `getChatById`, `observeChatById`, `getExpiredEphemeralChats`, `insertChat`, `deleteChat`, `bindChatServer`, `bindChatServerIfUnbound`, `clearChatServerBinding`, `setPersistKvCache`, `getChatsBoundToServer`, `observeBoundChatCounts`, `updateTitle`, `updateContextSize`, `updateLastModified`, `updateSystemPrompt`, `updateApiParams`, `updateFolder`, `clearFolder`, `updateAiHubPin`, `deleteEphemeralChatById`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/dao/LlamaDaos.kt:117
  • `LlamaScheduledTaskDao` declares 23 abstract methods: `getAllTasks`, `getTaskById`, `getDueTasks`, `getEnabledFutureTasks`, `insertTask`, `updateTask`, `deleteTaskById`, `setTaskEnabled`, `updateTaskRunState`, `getRecentLogs`, `getLogsForTask`, `getLogById`, `deleteLogById`, `deleteLogsByIds`, `deleteAllLogs`, `findLogByTaskScheduleAndStatus`, `getLogsByStatus`, `insertLog`, `updateLog`, `markLogRunning`, `markLogSuccess`, `markLogFailure`, `markLogSkipped`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/dao/LlamaDaos.kt:321
  • `LlamaServerCardDao` declares 16 abstract methods: `observeCards`, `getCard`, `countOtherCardsUsingPreset`, `getEasyCard`, `getWearStartCard`, `observeWearStartCard`, `clearWearStartFlags`, `markWearStartCard`, `insertCard`, `updateCardRow`, `deleteCard`, `deleteCardById`, `updateName`, `updateSavedCommand`, `updatePortRow`, `updateLinkedPort`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/dao/LlamaServerCardDao.kt:19
  • `NativeChatDelegateTaskDao` declares 25 abstract methods: `getIdsForChat`, `getById`, `observeById`, `getLatestForChat`, `observeLatestForChat`, `observeForChat`, `getInStates`, `getForChatInStates`, `getWithScheduledChecks`, `getWithPendingWakes`, `getByHarnessSession`, `getLatestWithWorkspace`, `insert`, `update`, `setState`, `setStateWithError`, `updateCounters`, `setOptions`, `setProgressNote`, `setDigest`, `setScheduledCheck`, `setPendingWake`, `claimPendingWake`, `countInStates`, `countForChatInStates`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/dao/NativeChatDelegationDaos.kt:18
  • `NativeChatDelegateMessageDao` declares 16 abstract methods: `getForTask`, `observeForTask`, `getActiveForTask`, `observeForTaskWithRoles`, `maxSeq`, `insert`, `getUndeliveredMainToSub`, `getUndeliveredSubToMain`, `getStatusSubMessage`, `taskIdsWithUndeliveredSubToMain`, `markDelivered`, `markSubToMainDelivered`, `seqOf`, `latestMainToSubContent`, `markCompactedThrough`, `retireOlderSummaries`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/dao/NativeChatDelegationDaos.kt:136
  • `AgentChatDao` declares 65 abstract methods: `getAllConversations`, `getProjectFolders`, `getConversation`, `observeConversation`, `insertConversationDirect`, `updateConversationDirect`, `deleteConversation`, `deleteConversationById`, `updateConversationTitle`, `updateConversationProjectMetadata`, `moveConversationToFolder`, `updateConversationSortOrder`, `updatePlanningMode`, `updateExecutionProfileDirect`, `normalizeAllExecutionProfiles`, `getConversationsNeedingDirectReanchor`, `updateResumeState`, `updateResumeStateIfIdle`, `touchConversation`, `updatePreviewUrlOverride`, `updateConversationState`, `updateKnowledgeBaseIds`, `updateRuntimeSettings`, `insertProjectFolder`, `updateProjectFolder`, `deleteProjectFolderById`, `getProjectFolder`, `renameProjectFolder`, `moveProjectFolder`, `updateProjectFolderSortOrder`, `updateProjectFolderCollapsed`, `getMessagesForConversation`, `getMessagesForConversationSync`, `getRecentMessagesForConversation`, `getRecentMessagesForConversationSync`, `getOlderMessagesForConversation`, `getNewerMessagesForConversation`, `getMessageByOriginalId`, `getToolMessage`, `cancelPendingToolApprovals`, and 25 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/AgentChatDao.kt:15
  • `AgentWorkflowDao` declares 146 abstract methods: `getConversationForDirectReanchor`, `archiveStaleSpecialistInvocations`, `closeStaleTurnContexts`, `cancelStalePendingInputs`, `cancelStaleContinuations`, `cancelStalePendingQuestions`, `cancelStalePendingPlans`, `cancelStaleMessageApprovals`, `cancelStaleSleepWakes`, `releaseStaleTodoAssignments`, `updateProjectStateForDirectReanchor`, `completeDirectReanchor`, `upsertSleepWake`, `getSleepWake`, `getSleepWakeForConversation`, `getPendingSleepWakes`, `claimSleepWake`, `completeSleepWake`, `cancelSleepWakeForConversation`, `upsertMessagePart`, `upsertMessageParts`, `observeMessageParts`, `observeMessagePartsForInvocation`, `getMessageParts`, `deleteMessageParts`, `deleteMessagePartsAtOrAfter`, `deleteMessagePartsForConversation`, `upsertTurnContext`, `getTurnContext`, `getLatestTurnContext`, `getLatestOpenTurnContext`, `finishTurnContext`, `upsertSkill`, `observeSkills`, `getEnabledSkills`, `getSkill`, `deleteSkill`, `upsertSkillAssignment`, `resolveSkillAssignment`, `observeSkillAssignments`, and 106 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowDao.kt:12
  • `AiServerDao` declares 55 abstract methods: `observeConfigs`, `getConfigs`, `getConfig`, `upsertConfig`, `upsertConfigs`, `setServerEnabled`, `observeUsers`, `getUsers`, `getUserByUsername`, `getUserById`, `upsertUser`, `deleteUser`, `observePermissions`, `getPermissionsForUser`, `getPermission`, `upsertPermission`, `upsertPermissions`, `upsertSession`, `getSession`, `deleteSession`, `deleteExpiredSessions`, `upsertArtifact`, `observeArtifactsForServer`, `observeArtifactsByType`, `observeServerArtifactPathsByType`, `getArtifactsForServer`, `getArtifactById`, `deleteArtifactByPath`, `deleteArtifactById`, `getWebProviders`, `getWebProvidersForOwner`, `getWebProvider`, `getWebProviderForOwner`, `upsertWebProvider`, `deleteWebProvider`, `getWebChats`, `getWebChatsForOwner`, `getWebChat`, `getWebChatForOwner`, `upsertWebChat`, and 15 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/AiServerEntities.kt:246
  • `AppDatabase` declares 55 abstract methods: `modelLibraryDao`, `modelDao`, `chatDao`, `systemPromptDao`, `noteDao`, `zimDao`, `savedWorkerDao`, `savedCommandDao`, `llamaServerCardDao`, `workflowTemplateDao`, `benchmarkDao`, `datasetDao`, `agentChatDao`, `agentProotEnvironmentDao`, `agentProotRunDao`, `harnessDao`, `harnessTransferDao`, `harnessInstallationDao`, `agentWorkflowDao`, `customToolDao`, `customAgentDao`, `agentRuntimeProfileDao`, `agentRuntimeEndpointConfigDao`, `ollamaServerDao`, `aiRuntimeJobDao`, `llamaServerDao`, `llamaChatFolderDao`, `llamaChatPromptProfileDao`, `llamaChatDao`, `llamaMessageDao`, `nativeChatDelegateTaskDao`, `nativeChatDelegateMessageDao`, `nativeChatDelegateEventDao`, `llamaMessageAttachmentDao`, `nativeChatCompactionDao`, `llamaMessageImageDescriptionDao`, `llamaScheduledTaskDao`, `llamaSpeculativeRunDao`, `organizerDao`, `quadtrixProfileDao`, and 15 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/AppDatabase.kt:195
  • `DatasetDao` declares 49 abstract methods: `getAllProjects`, `getProjectFlow`, `getProject`, `insertProject`, `updateProject`, `deleteProject`, `getSourcesForProject`, `getSourcesForProjectSync`, `getSource`, `getSourceByProjectAndUri`, `insertSource`, `updateSource`, `deleteSource`, `getSourceCount`, `getChunksForProject`, `getChunksForProjectSync`, `getChunksForSource`, `getChunk`, `getChunksByStatus`, `insertChunk`, `insertChunks`, `updateChunk`, `deleteChunk`, `deleteChunksByIds`, `deleteChunksForSource`, `getChunkCount`, `getChunkCountForSource`, `getQAForProject`, `getQAForProjectSync`, `getQAForChunk`, `getQA`, `getQAByMinScore`, `getUnratedQA`, `getQAByStatus`, `insertQA`, `insertQAs`, `updateQA`, `deleteQA`, `deleteQAForChunk`, `getQACount`, and 9 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/DatasetDao.kt:10
  • `GenerationQueueDao` declares 19 abstract methods: `observeQueue`, `historyPagingSource`, `observePendingCount`, `pendingCount`, `observeRunSummary`, `runSummary`, `observeControl`, `getControl`, `getItem`, `nextPending`, `pendingOrder`, `updatePendingOrder`, `assignRunToPending`, `runningItems`, `maxSortOrder`, `putItem`, `updateItem`, `deletePending`, `putControl`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/GenerationQueueEntities.kt:84
  • `HarnessDao` declares 20 abstract methods: `runtime`, `observeRuntime`, `observeRuntimes`, `activeRuntimes`, `deleteRuntime`, `saveRuntime`, `observeWorkspaces`, `workspaces`, `workspace`, `workspaceForRoot`, `saveWorkspaceForRuntime`, `deleteUnreferencedWorkspace`, `session`, `sessionForConversation`, `observeSessions`, `saveSessionForRuntime`, `observeLegacyConversations`, `conversations`, `legacyMessagePreviews`, `legacyMessageChunk`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/HarnessDao.kt:17
  • `HarnessInstallationDao` declares 17 abstract methods: `observeAll`, `getAll`, `getById`, `observeById`, `insert`, `update`, `markReady`, `updateSize`, `deleteById`, `deleteConversationsForRuntime`, `deleteRuntimeJobsForRuntime`, `deleteSessionsForRuntime`, `deleteWorkspacesForRuntime`, `deleteTransferReceiptsForRuntime`, `countExternalRuntimeReferences`, `deleteRuntimeProcessRow`, `deleteEnvironmentIfUnreferenced`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/HarnessInstallationDao.kt:20
  • `KnowledgeBaseDao` declares 44 abstract methods: `observeKnowledgeBases`, `getKnowledgeBasesOnce`, `getKnowledgeBase`, `getKnowledgeBaseByName`, `getKnowledgeBasesByIds`, `insertKnowledgeBase`, `updateKnowledgeBase`, `deleteKnowledgeBaseById`, `observeSources`, `getSourcesOnce`, `getAllSourcesOnce`, `getSource`, `getSourcesByIds`, `getSourceByRef`, `insertSource`, `updateSource`, `deleteSource`, `deleteSourceById`, `setSourceEnabled`, `updateSourceProgress`, `markIndexedSourcesStaleForConfig`, `deleteChunksForSource`, `insertChunks`, `updateChunkEmbedding`, `getSearchableChunks`, `getChunk`, `getChunksForSource`, `getChunksForSourcePaged`, `getChunksMissingEmbedding`, `getNeighborChunks`, `observeKnowledgeBaseCount`, `getKnowledgeBaseCount`, `observeSourceCount`, `observeSourceCountExcluding`, `observeChunkCount`, `observeChunkCountExcluding`, `observeErrorSourceCount`, `observeErrorSourceCountExcluding`, `observePendingSourceCount`, `observePendingSourceCountExcluding`, and 4 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/KnowledgeBaseDao.kt:12
  • `ModelLibraryDao` declares 35 abstract methods: `observeSources`, `observeSourcesByFamily`, `getSourceById`, `getByNormalizedKey`, `upsert`, `invalidateSourceInstallationEvidence`, `invalidateSourceBundleEvidence`, `invalidateSourcePendingPayloads`, `upsertSources`, `deleteSourceById`, `observeProvenance`, `observeProvenanceBySource`, `getProvenanceBySource`, `updateProvenanceReference`, `getByModelKey`, `deleteProvenanceById`, `deleteByModelKey`, `observeBundles`, `observeBundlesByFamily`, `getBundleById`, `deleteBundleById`, `getForBundle`, `observeForBundle`, `getBundleItemById`, `upsertBundleItems`, `deleteBundleItemById`, `deleteForBundle`, `getWithItems`, `observePendingArtifacts`, `observeByStatuses`, `getPendingArtifactById`, `getPendingArtifactsForBundle`, `getByDownloadTaskId`, `upsertPendingArtifacts`, `deletePendingArtifactById`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/ModelLibraryEntities.kt:177
  • `OrganizerDao` declares 22 abstract methods: `getAllEvents`, `getAllEventsOnce`, `getEventsInRange`, `getEventsInRangeOnce`, `getEventById`, `insertEvent`, `updateEvent`, `deleteEvent`, `deleteEventById`, `getAllAlarms`, `getAllAlarmsOnce`, `getAlarmsForEventOnce`, `getAlarmById`, `getEnabledFutureAlarms`, `insertAlarm`, `updateAlarm`, `deleteAlarm`, `deleteAlarmById`, `markAlarmDelivered`, `getLlmSettings`, `getLlmSettingsOnce`, `upsertLlmSettings`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/OrganizerDao.kt:12
  • `SdDistributedDao` declares 21 abstract methods: `observeWorkers`, `observeEnabledWorkers`, `observeWorkersOrdered`, `getEnabledWorkersOnce`, `getMaxWorkerSortOrder`, `upsertWorker`, `updateWorker`, `deleteWorker`, `setWorkerEnabled`, `setWorkerSortOrder`, `observeMasterSettings`, `getMasterSettings`, `upsertMasterSettings`, `observeTemplates`, `upsertTemplate`, `deleteTemplate`, `observePlacements`, `upsertPlacement`, `deletePlacement`, `observeRecentRuns`, `insertRun`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/data/db/SdDistributedEntities.kt:196
  • `HarnessTransferDao` declares 20 abstract methods: `workspaces`, `sessions`, `conversations`, `messagesForConversations`, `messagePartsForConversations`, `allWorkspaceIds`, `allConversationIds`, `sessionIds`, `messageOriginalIds`, `messagePartIds`, `receipt`, `harnessWorkspaceIds`, `activeJobCount`, `activeRunCount`, `insertWorkspaces`, `insertConversations`, `insertSessions`, `insertMessages`, `insertMessageParts`, `insertReceipt`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/harness/HarnessTransferMetadata.kt:882
  • `FarmDao` declares 16 abstract methods: `observeTiles`, `getTiles`, `saveTile`, `saveTiles`, `observeUpgrades`, `getUpgrades`, `getUpgrade`, `saveUpgrade`, `saveUpgrades`, `observeLivestock`, `getLivestock`, `getLivestockByType`, `saveLivestock`, `clearTilesForPet`, `clearUpgradesForPet`, `clearLivestockForPet`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/tama/db/FarmDao.kt:39
  • `TamaDao` declares 132 abstract methods: `getPet`, `observePet`, `getActivePet`, `observeActivePet`, `getAllPetIds`, `savePet`, `deletePet`, `updateStats`, `updateMoney`, `updateLocation`, `updateActivityStatus`, `saveEvent`, `saveEvents`, `getRecentEvents`, `observeRecentEvents`, `getAllEvents`, `getEventsSince`, `deleteEventsForPet`, `saveQuest`, `saveQuests`, `getQuestsForPet`, `getQuestsByStatus`, `deleteStaleAvailableQuests`, `deleteQuestsForPet`, `saveQuestChecklistItem`, `saveQuestChecklistItems`, `observeQuestChecklist`, `getQuestChecklist`, `getQuestChecklistItem`, `deleteQuestChecklistItem`, `deleteCheckedQuestChecklistItems`, `deleteQuestChecklistForPet`, `saveDeepDreamRun`, `saveDeepDreamRuns`, `getDeepDreamRun`, `getDeepDreamRunBySignature`, `getDeepDreamRunByAlbumId`, `getDeepDreamRunsForPet`, `getDeepDreamRunsForPetByStatuses`, `getDeepDreamRunsByStatuses`, and 92 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/com/example/llamadroid/tama/db/TamaDao.kt:427

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
C1 · Data Protection3.5 / 10Weak✓ Tool-verified

Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.

Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.

What to do

  • Strengthen data-at-rest protection: vault your keys (AWS KMS / Secrets Manager, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault — not a key compiled into the app) and encrypt the store that holds the personal data (SQLCipher, a Realm encryptionKey, field-level AEAD) — partial coverage still leaves gaps.
  • Enforce HTTPS on the server that receives this data: terminate TLS in it (Ktor's sslConnector, Spring's server.ssl and requiresSecure, Netty's SslContextBuilder.forServer) and send Strict-Transport-Security (Ktor's HttpsRedirect), or run it behind a TLS-terminating proxy, so data in transit is always encrypted.
C4 · Data Retention10.0 / 10Exemplary✓ Tool-verified

Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).

Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.

DM10 · One transaction, one aggregate9.5 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether a single operation mutates more than one aggregate root. An aggregate is a consistency boundary, so saving two together fuses them into one — the second's invariants come to depend on the first's transaction, and the pair can no longer be separated. Reads of other aggregates are not counted.

Method: Neutral body surface (DDD-gated): every method body scanned for repository WRITE calls (Add/Update/Save/Remove/Delete/Insert/Store and their async forms), keyed on the ARGUMENT type rather than the repository type — three `IRepository<T>` writes collapse to one repository but are three distinct aggregates. Reads (Get/Find/Load/Query) are excluded, so loading another aggregate for context never counts. Score is offending methods over methods that write at all. Deterministic.

  • `LlamaServerSessionRuntime.remove` saves `LlamaServerSessionOwnerStore`, `LlamaServerSessionLogStore`, `LlamaServerSessionStateStore` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — app/src/main/java/com/example/llamadroid/service/LlamaServerSessionRuntime.kt:368
  • `OnnxTtsGenerationService.startGeneration` saves `Idle`, `Error` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — app/src/main/java/com/example/llamadroid/service/OnnxTtsGenerationService.kt:149
  • `PetTransferCoordinator.reclaimAnyway` saves `TransferState`, `Nothing` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:383
  • `PetTransferCoordinator.abandon` saves `TransferState`, `Nothing` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:402
  • `PetTransferReceiveCommit.recoverInterrupted` saves `Nothing`, `TransferState` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferReceiveCommit.kt:117

What to do

  • Mutate one aggregate per operation and let the others follow from a domain event — the second aggregate reaching consistency a moment later is the design, not a compromise.
DM11 · Constructible invalid state3.1 / 10Weak✓ Tool-verified

Other · Domain Modelling — Whether an aggregate can be constructed in a state its own rules forbid — a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.

Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule / an XException.ThrowIf* helper). C#: a static factory beside a public constructor does not exempt it, and a public parameterless constructor followed by public raw-primitive setters that refuse nothing is charged when the type also declares a validating way in (a guarded constructor or a guarding static method returning the type); TypeScript: a static Create/Of/From/New factory exempts the type. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.

  • `AudioVoiceProfileEntity`'s public constructor takes `id`, `name`, `language`, `originalPath`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AudioVoiceProfileEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/audio/AudioEntities.kt:20
  • `AudioGenerationJobEntity`'s public constructor takes `id`, `adapterId`, `family`, `modelId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AudioGenerationJobEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/audio/AudioEntities.kt:86
  • `AudioLibraryFolderEntity`'s public constructor takes `id`, `name`, `parentId` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AudioLibraryFolderEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryEntities.kt:19
  • `AudioLibraryItemEntity`'s public constructor takes `id`, `originKey`, `title`, `audioPath`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AudioLibraryItemEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryEntities.kt:37
  • `AudioLibraryPreferencesEntity`'s public constructor takes `id`, `query`, `sort`, `folderId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AudioLibraryPreferencesEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryEntities.kt:58
  • `AgentConversationEntity`'s public constructor takes `title`, `projectFolder`, `resumeState`, `lastStopReason`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentConversationEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:19
  • `AgentProjectFolderEntity`'s public constructor takes `name` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProjectFolderEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:71
  • `AgentMessageEntity`'s public constructor takes `originalId`, `role`, `content`, `imagePath`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentMessageEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:98
  • `AgentProjectRunEntity`'s public constructor takes `projectFolder`, `backend`, `prootEnvironmentId`, `runtime`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProjectRunEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:144
  • `AgentProotEnvironmentEntity`'s public constructor takes `id`, `displayName`, `storageKey`, `imageId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProotEnvironmentEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:183
  • `AgentProotRunEntity`'s public constructor takes `id`, `environmentId`, `projectFolder`, `commandDigest`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProotRunEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:261
  • `AgentProjectEventEntity`'s public constructor takes `projectFolder`, `category`, `eventType`, `phase`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProjectEventEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:313
  • `AgentRuntimeEndpointConfigEntity`'s public constructor takes `name`, `backend`, `baseUrl`, `defaultModel` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentRuntimeEndpointConfigEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentRuntimeEndpointConfigEntity.kt:21
  • `AgentRuntimeProfileEntity`'s public constructor takes `agentKey`, `backend`, `model` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentRuntimeProfileEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentRuntimeProfileEntity.kt:19
  • `AgentMessagePartEntity`'s public constructor takes `id`, `messageOriginalId`, `type`, `status`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentMessagePartEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:34
  • `AgentTurnContextEntity`'s public constructor takes `rootTurnId`, `agentKey`, `status`, `backend`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentTurnContextEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:75
  • `AgentSkillEntity`'s public constructor takes `id`, `name`, `description`, `version`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentSkillEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:111
  • `AgentSkillAssignmentEntity`'s public constructor takes `skillId`, `agentKey`, `permission` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentSkillAssignmentEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:143
  • `AgentPendingQuestionEntity`'s public constructor takes `id`, `rootTurnId`, `agentSessionId`, `toolCallId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentPendingQuestionEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:168
  • `AgentPendingPlanEntity`'s public constructor takes `id`, `rootTurnId`, `agentSessionId`, `planMessageId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentPendingPlanEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:215
  • `AgentTodoEntity`'s public constructor takes `id`, `text`, `status`, `priority`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentTodoEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:254
  • `AgentCompactionEntity`'s public constructor takes `id`, `rootTurnId`, `summaryText`, `focus`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentCompactionEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:295
  • `AgentProjectStateEntity`'s public constructor takes `mode`, `currentGoal`, `activePlanVersionId`, `currentPhaseId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProjectStateEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:336
  • `AgentPlanVersionEntity`'s public constructor takes `id`, `sourcePendingPlanId`, `summary`, `planMarkdown`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentPlanVersionEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:377
  • `AgentWorkReportEntity`'s public constructor takes `id`, `invocationId`, `todoId`, `agentRole`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentWorkReportEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:410
  • `AgentInvocationEntity`'s public constructor takes `id`, `rootTurnId`, `parentToolCallId`, `agentClass`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentInvocationEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:452
  • `AgentPendingInputEntity`'s public constructor takes `id`, `targetInvocationId`, `batchId`, `kind`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentPendingInputEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:506
  • `AgentProjectContractEntity`'s public constructor takes `initialGoal`, `initialGoalSource` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProjectContractEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:543
  • `AgentDecisionEntity`'s public constructor takes `id`, `rootTurnId`, `questionId`, `decisionKey`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentDecisionEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:579
  • `AgentContinuationOutboxEntity`'s public constructor takes `id`, `rootTurnId`, `kind`, `dedupeKey`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentContinuationOutboxEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:623
  • `AgentSleepWakeEntity`'s public constructor takes `id`, `rootTurnId`, `reason`, `status` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentSleepWakeEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:662
  • `AiRuntimeJobEntity`'s public constructor takes `jobId`, `jobKey`, `type`, `status`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AiRuntimeJobEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AiRuntimeJobEntity.kt:19
  • `AiServerConfigEntity`'s public constructor takes `serverType`, `displayName`, `accessMode` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AiServerConfigEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AiServerEntities.kt:15
  • `AiServerUserEntity`'s public constructor takes `username`, `displayName`, `passwordHash`, `passwordSalt` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AiServerUserEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AiServerEntities.kt:30
  • `AiServerPermissionEntity`'s public constructor takes `serverType` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AiServerPermissionEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AiServerEntities.kt:57
  • `AiServerSessionEntity`'s public constructor takes `tokenHash` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AiServerSessionEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AiServerEntities.kt:79
  • `AiServerArtifactEntity`'s public constructor takes `serverType`, `origin`, `jobId`, `artifactType`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AiServerArtifactEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AiServerEntities.kt:105
  • `AiServerWebProviderEntity`'s public constructor takes `name`, `engine`, `baseUrl`, `modelName`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AiServerWebProviderEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AiServerEntities.kt:123
  • `AiServerWebChatEntity`'s public constructor takes `title`, `systemPrompt`, `apiParamsJson` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AiServerWebChatEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AiServerEntities.kt:151
  • `AiServerWebMessageEntity`'s public constructor takes `role`, `content`, `imagePath`, `audioPath`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AiServerWebMessageEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/example/llamadroid/data/db/AiServerEntities.kt:174

What to do

  • Give each aggregate one way in that can refuse — a guarded constructor, value-object parameters that validate themselves, or a private constructor behind a factory that returns a failure.
DM4 · Rich vs anemic model3.0 / 10Weak✓ Tool-verified

Other · Domain Modelling — Whether aggregates/entities carry the behaviour that protects their invariants, rather than being data bags driven by external services.

Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.

Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.

  • `BenchmarkResult` is an aggregate/entity with 11 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/example/llamadroid/data/db/BenchmarkResult.kt:11
  • `SavedCommand` is an aggregate/entity with 46 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/example/llamadroid/data/db/SavedCommandEntity.kt:21
  • `SavedWorker` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/example/llamadroid/data/model/SavedWorker.kt:11

What to do

  • Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.
DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether entities protect their state — private/init-only setters, and collections handed out as read-only views rather than the mutable backing collection — instead of exposing writable state that bypasses invariants. Softened when a rehydration framework (Marten/EF) is present.

Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.

DM9 · Scattered domain decisions10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.

Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.

M1 · Documentation (README)7.4 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation2.0 / 10Weak✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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.

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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.

P2 · Observability6.5 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling4.0 / 10Weak✓ Tool-verified

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.

  • `app/build.gradle.kts` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — app/build.gradle.kts:407

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `Retrofit.Builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:117, app/src/main/java/com/example/llamadroid/data/model/library/ModelLibraryRepositoryFactory.kt:15, app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:269
  • `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — app/src/main/java/com/example/llamadroid/data/proot/ProotManager.kt:81

What to do

  • Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

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.

  • `generateWebChatReply` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:3075
  • `streamOllamaResponse` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1669
  • `streamNativeToolResponse` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1908
  • `unifyRecursively` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — app/src/main/java/com/example/llamadroid/service/RemoteSummaryOrchestrator.kt:183
  • `splitForBudget` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — app/src/main/java/com/example/llamadroid/service/RemoteSummaryOrchestrator.kt:336

What to do

  • Kotlin: call the suspend function directly instead of wrapping it in runBlocking, use delay() instead of Thread.sleep, and move unavoidable blocking I/O into withContext(Dispatchers.IO).
X1 · Async correctness8.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

  • This coroutine runs on a dispatcher's thread, and `Thread.sleep` blocks that thread: for the whole delay no other coroutine scheduled on it makes progress (on `Dispatchers.Main` the UI freezes) — the Kotlin form of blocking on a task. Use `delay(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a call that cannot be made suspending, move it off the dispatcher with `withContext(Dispatchers.IO) { … }`. (×2) — app/src/main/java/com/example/llamadroid/service/SSHService.kt:388, app/src/main/java/com/example/llamadroid/service/SSHService.kt:809

What to do

  • Blocking `Thread.sleep` inside a coroutine
X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document4.3 / 10Weak✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `harnessTextFrom` is public and takes `value: JsonElement` from its caller, and it calls itself at line 118 with a piece of `value` (and at line 125) — the function is not `tailrec`, so every call is a real frame — and nowhere in `harnessTextFrom` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `harnessTextFrom` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessFormatting.kt:118

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation4.7 / 10Adequate✓ Tool-verified

Other · Code Health — Whether functions that make a cancellable request accept or pass on an AbortSignal or the coroutine's cancellation (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 3/26 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; Ktor, OkHttp newCall, URL streams) accept an AbortSignal or the coroutine's cancellation or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` () and hand it to the request; in a Kotlin suspend function, make the request with a call that suspends — Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` that cancels the `Call` — not a blocking `execute()`: `withContext(Dispatchers.IO)` moves the call off the caller's thread but does not make it cancellable; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `awaitPreview` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. (×2) — app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:299, app/src/main/java/com/example/llamadroid/harness/HarnessRemoteProjectRunner.kt:438
  • `probeAgentEndpoint` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/AgentService.kt:1339
  • `installFromHttps` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/AgentSkillRepository.kt:140
  • `searchWeb` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/DeepResearchSupport.kt:125
  • `fetchReadableSource` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/DeepResearchSupport.kt:241
  • `countChatInputTokens` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt:214
  • `discoverCapabilities` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt:879
  • `webSearch` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2023
  • `kiwixSearch` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2151
  • `post` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/vision/VisionDescriptionService.kt:182
  • `postJson` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/ephemeral/EphemeralLlamaServer.kt:168
  • `probe` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/compaction/NativeChatContextWindow.kt:43
  • `fetchTotalSlots` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/service/chat/ChatAdmissionPlanner.kt:89
  • `downloadHarnessFile` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/harness/HarnessAttachmentViewer.kt:62
  • `searchKiwix` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/harness/HarnessBridgeOperations.kt:555
  • `readKiwixArticle` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/harness/HarnessBridgeOperations.kt:596
  • `models` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/harness/HarnessLocalModels.kt:177
  • `proxy` suspends, but makes its request with `call.execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/harness/HarnessLocalModels.kt:1077
  • `fetch` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/data/runtime/AgentRuntimeEndpointModelDiscovery.kt:22
  • `downloadRootfs` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/data/proot/ProotManager.kt:68
  • `fetchCatalog` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/example/llamadroid/data/model/KiwixCatalogClient.kt:45
  • `load` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — app/src/main/assets/file_station_webui/js/i18n.js:16

What to do

  • Thread an AbortSignal or the coroutine's cancellation through functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling5.4 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `catch (_: RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×10) — app/src/main/java/com/example/llamadroid/MainActivity.kt:308, app/src/main/java/com/example/llamadroid/MainActivity.kt:322, app/src/main/java/com/example/llamadroid/MainActivity.kt:337, …
  • `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×4) — app/src/main/java/com/example/llamadroid/util/GGUFParser.kt:154, app/src/main/java/com/example/llamadroid/ui/models/ModelManagerViewModel.kt:157, app/src/main/java/com/example/llamadroid/ui/models/ModelShareScreen.kt:490, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×17) — app/src/main/java/com/example/llamadroid/util/NsdHelper.kt:180, app/src/main/java/com/example/llamadroid/util/NsdHelper.kt:189, app/src/main/java/com/example/llamadroid/util/NsdHelper.kt:209, …
  • `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×5) — app/src/main/java/com/example/llamadroid/util/UpscalerAssetPackSupport.kt:271, app/src/main/java/com/example/llamadroid/ui/easy/EasyModelRemoval.kt:119, app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3893, …
  • `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×4) — app/src/main/java/com/example/llamadroid/ui/easy/EasyChatModelPicker.kt:108, app/src/main/java/com/example/llamadroid/ui/easy/EasyChatModelPicker.kt:135, app/src/main/java/com/example/llamadroid/ui/easy/EasyChatOptionsSheet.kt:213, …

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X5 · Nullable reference types9.9 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether Kotlin's null safety is not undermined by not-null assertions — `String` cannot hold null and `String?` must be checked before use in every Kotlin module, and each `!!` is a run-time `NullPointerException` the author has told the compiler cannot happen.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

WCAG coverage — what static analysis assessed

Statically assessed 10 of 55 WCAG 2.2 Level A/AA success criteria (18%; ≈20% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 45 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 45 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.1.1, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.1, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

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.

LensScoreRatingImpact
Code Health62.1Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture91.2ExemplaryStrongest area.
Maturity65.0Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness47.8Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security60.9Adequate — gated by D29, D36, C1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling54.3Adequate — gated by DM4, DM11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility54.5Adequate — gated by AC6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60.0AdequateAcceptable, with room to improve.
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.

  • X6 Hand-rolled structured-format parsing — 7 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Repo shows no audit-logging mechanism (an audit-log table or model — an Exposed table, a data class, a Room entity or a SQL migration's table named for it — Hibernate Envers' @Audited, a JPA entity listener, Hibernate event listener or jOOQ RecordListener that records each change) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
  • C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
  • P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
Not included — 58 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 image/media element found in the parsed markup — AC1 not applicable here.
  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the Android app did not build — `./gradlew :app:assembleDebug` exited 1: ct :app > Could not resolve com.termux.termux-app:terminal-view:0.118.0. > Could not get resource 'https://jitpack.io/com/termux/termux-app/terminal-view/0.118.0/terminal-view-0.118.0.p…; runtime evidence skipped (launch chosen because app/build.gradle.kts applies the Android application plugin and gradlew builds it) This is a statement about this run, not a statement about your application: nothing here says the app is inaccessible, only that it was never run.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~102929 lines of test source are present (.kt) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .kt suite was found but not re-run
  • D12 Dependency Hygiene — Not scored — a Gradle build resolved 420 artifact(s) across its subprojects (165 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • 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.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .kt, .py, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 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.
  • D34 Knowledge Freshness — history too condensed to judge knowledge freshness
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
  • DM1 Aggregate boundaries — no aggregates detected — aggregate-boundary check not applicable
  • DM12 Ambient inputs in the domain — no domain-layer types detected — ambient-input check not applicable
  • DM2 Strongly-typed ids — no id-bearing domain types detected — strongly-typed-id adoption not assessable
  • DM3 Integration-event coupling — no integration events detected — coupling check not applicable
  • DM6 Domain ↔ infrastructure boundary — no domain-layer types detected — domain↔infrastructure boundary check not applicable
  • DM7 Repository granularity — no repository abstraction detected (e.g. uses a document session)
  • DM8 Value-object opportunities — not scored — the deterministic rule found 0 candidate clump(s); its rows are withheld until it has a measured precision of 95 % (a sample of fewer than 10 rows cannot show one)
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • 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 data present for 2 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a pom.xml, Gradle or sbt build, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X10 Duplicated predicate — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Kotlin was read, and it logs through none that an assembled message defeats: Android's `Log` and Timber, java.util.logging and log4j-api-kotlin take one finished message (as log4net does in C#), or it makes no call through a named logger at all. Calls made through SLF4J, log4j 2 or kotlin-logging (`LoggerFactory.getLogger`, `KotlinLogging.logger {}`) would be judged.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 15 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
Serious — 3336 finding(s)
D3 · God Classes · MethodTooLong · ×270
  • MethodTooLong: ImageGenScreenKt.ImageGenScreen app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:140 — MethodTooLong — ImageGenScreen runs 3262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3162 over it, 32.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MasterModeScreenKt.MasterModeScreen app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:121 — MethodTooLong — MasterModeScreen runs 2482 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2382 over it, 24.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Companion.executeToolCall app/src/main/java/com/example/llamadroid/service/AgentService.kt:11014 — MethodTooLong — executeToolCall runs 2321 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2221 over it, 23.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Companion.sendMessage app/src/main/java/com/example/llamadroid/service/AgentService.kt:8199 — MethodTooLong — sendMessage runs 2168 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2068 over it, 21.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SdDistributedScreensKt.SdDistributedMasterScreen app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:616 — MethodTooLong — SdDistributedMasterScreen runs 1450 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1350 over it, 14.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LLMSettingsScreenKt.LlmSettingsContent app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:92 — MethodTooLong — LlmSettingsContent runs 1352 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1252 over it, 13.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: WorkflowsScreenKt.WorkflowsScreen app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:98 — MethodTooLong — WorkflowsScreen runs 1128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1028 over it, 11.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: VideoGenScreenKt.VideoGenScreen app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:195 — MethodTooLong — VideoGenScreen runs 1060 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 960 over it, 10.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: OnnxImageGenScreenKt.OnnxImageGenScreen app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:149 — MethodTooLong — OnnxImageGenScreen runs 991 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 891 over it, 9.91× 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: PDFToolboxScreenKt.PDFToolboxScreen app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:67 — MethodTooLong — PDFToolboxScreen runs 990 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 890 over it, 9.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LlamaService.startServer app/src/main/java/com/example/llamadroid/service/LlamaService.kt:585 — MethodTooLong — startServer runs 925 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 825 over it, 9.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MasterModeScreenKt.RemoteMasterCard app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3845 — MethodTooLong — RemoteMasterCard runs 904 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 804 over it, 9.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WorkflowsScreenKt.MangaTranslationWorkflowContent app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1497 — MethodTooLong — MangaTranslationWorkflowContent runs 858 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 758 over it, 8.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: GeneralSettingsScreenKt.GeneralSettingsScreen app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:73 — MethodTooLong — GeneralSettingsScreen runs 829 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 729 over it, 8.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: VideoSumupScreenKt.VideoSumupScreen app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:72 — MethodTooLong — VideoSumupScreen runs 653 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 553 over it, 6.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: HarnessAgentRouteKt.HarnessCapturedAgentRoute app/src/main/java/com/example/llamadroid/harness/HarnessAgentRoute.kt:148 — MethodTooLong — HarnessCapturedAgentRoute runs 632 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 532 over it, 6.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Companion.getAgentTools app/src/main/java/com/example/llamadroid/service/AgentService.kt:17281 — MethodTooLong — getAgentTools runs 615 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 515 over it, 6.15× 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: NotesManagerScreenKt.NotesManagerScreen app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:104 — MethodTooLong — NotesManagerScreen runs 604 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 504 over it, 6.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TermuxScreenKt.TermuxScreen app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:64 — MethodTooLong — TermuxScreen runs 594 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 494 over it, 5.94× 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: LiteRtModelsScreenKt.LiteRtModelsScreen app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:160 — MethodTooLong — LiteRtModelsScreen runs 571 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 471 over it, 5.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RemoteServerFormKt.RemoteServerForm app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/RemoteServerForm.kt:65 — MethodTooLong — RemoteServerForm runs 538 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 438 over it, 5.38× 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: TermuxFileManagerScreenKt.TermuxFileManagerScreen app/src/main/java/com/example/llamadroid/ui/ai/TermuxFileManagerScreen.kt:98 — MethodTooLong — TermuxFileManagerScreen runs 510 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 410 over it, 5.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LlamaSchedulerScreenKt.LlamaScheduledTaskEditorDialog app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:652 — MethodTooLong — LlamaScheduledTaskEditorDialog runs 506 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 406 over it, 5.06× 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: LlamaChatListScreenKt.LlamaChatListContent app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatListScreen.kt:91 — MethodTooLong — LlamaChatListContent runs 503 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 403 over it, 5.03× 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: DownloadService.startDownloadInternal app/src/main/java/com/example/llamadroid/service/DownloadService.kt:565 — MethodTooLong — startDownloadInternal runs 468 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 368 over it, 4.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 245 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×183
  • FileTooLong: service/AgentService.kt app/src/main/java/com/example/llamadroid/service/AgentService.kt — FileTooLong — 15797 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: AgentService (301-20821). The bar is 500 significant lines; this is 15297 over it, 31.59× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: service/PDFService.kt app/src/main/java/com/example/llamadroid/service/PDFService.kt — FileTooLong — 6401 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 5901 over it, 12.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ai/WorkflowsScreen.kt app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt — FileTooLong — 5792 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 5292 over it, 11.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ui/TamaScreen.kt app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt — FileTooLong — 4819 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4319 over it, 9.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: data/SettingsRepository.kt app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt — FileTooLong — 4227 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: SettingsRepository (188-6114). The bar is 500 significant lines; this is 3727 over it, 8.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: service/AiToolServerService.kt app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt — FileTooLong — 4114 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: AiToolServerService (139-5109). The bar is 500 significant lines; this is 3614 over it, 8.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: ai/ImageGenScreen.kt app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt — FileTooLong — 4029 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3529 over it, 8.06× 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: distributed/MasterModeScreen.kt app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt — FileTooLong — 3808 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3308 over it, 7.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: distributed/SdDistributedScreens.kt app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt — FileTooLong — 3791 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3291 over it, 7.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ui/AdventureGateScreen.kt app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt — FileTooLong — 3636 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3136 over it, 7.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: service/NativeChatTools.kt app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt — FileTooLong — 3409 significant lines (blank, comment-only and punctuation-only lines excluded), about 61% of them inside a single declaration: NativeChatToolRuntime (937-3545). The bar is 500 significant lines; this is 2909 over it, 6.82× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: agent/AgentDialogs.kt app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt — FileTooLong — 3385 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2885 over it, 6.77× 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: game/TamaGameEngine.kt app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt — FileTooLong — 3382 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: TamaGameEngine (64-4568). The bar is 500 significant lines; this is 2882 over it, 6.76× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: service/LlamaClientService.kt app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt — FileTooLong — 3381 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2881 over it, 6.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: db/Migrations.kt app/src/main/java/com/example/llamadroid/data/db/Migrations.kt — FileTooLong — 3139 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2639 over it, 6.28× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: service/AgentProjectControlPlane.kt app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt — FileTooLong — 2896 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: AgentDirectReceiptTransition (249-3731). The bar is 500 significant lines; this is 2396 over it, 5.79× 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: ai/SDModelsScreen.kt app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt — FileTooLong — 2778 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2278 over it, 5.56× 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: wear/MainActivity.kt wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt — FileTooLong — 2658 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2158 over it, 5.32× 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: agent/AgentWorkspaceScreen.kt app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt — FileTooLong — 2291 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1791 over it, 4.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: service/LiteRtLmChatService.kt app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt — FileTooLong — 2233 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1733 over it, 4.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: wear/PhoneWearGateway.kt app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt — FileTooLong — 2151 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1651 over it, 4.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: notes/NotesManagerScreen.kt app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt — FileTooLong — 2142 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1642 over it, 4.28× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ai/VideoGenScreen.kt app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt — FileTooLong — 2105 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1605 over it, 4.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: service/AgentRuntimeSupport.kt app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt — FileTooLong — 2049 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1549 over it, 4.10× 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: llama/LlamaSchedulerScreen.kt app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt — FileTooLong — 1914 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1414 over it, 3.83× 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.
  • + 158 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×120
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:140 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 475 in ImageGenScreenKt.ImageGenScreen at line 140. 8 of those changes were fix/bug commits, and the other 12 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/service/AgentService.kt app/src/main/java/com/example/llamadroid/service/AgentService.kt:11014 — app/src/main/java/com/example/llamadroid/service/AgentService.kt changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 323 in AgentService.executeToolCall at line 11014. 8 of those changes were fix/bug commits, and the other 12 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/service/AgentService.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/service/LlamaService.kt app/src/main/java/com/example/llamadroid/service/LlamaService.kt:585 — app/src/main/java/com/example/llamadroid/service/LlamaService.kt changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 257 in LlamaService.startServer at line 585. 4 of those changes were fix/bug commits, and the other 6 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/service/LlamaService.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:121 — app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 239 in MasterModeScreenKt.MasterModeScreen at line 121. 3 of those changes were fix/bug commits, and the other 6 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:98 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 112 in WorkflowsScreenKt.WorkflowsScreen at line 98. 6 of those changes were fix/bug commits, and the other 10 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:700 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in SDModelsScreenKt.InstalledSDModelsTab at line 700. 7 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:616 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 120 in SdDistributedScreensKt.SdDistributedMasterScreen at line 616. 6 of those changes were fix/bug commits, and the other 7 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:195 — app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in VideoGenScreenKt.VideoGenScreen at line 195. 5 of those changes were fix/bug commits, and the other 7 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:149 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 137 in TamaScreenKt.TamaScreen at line 149. 4 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:130 — app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 122 in AgentWorkspaceScreenKt.AgentWorkspaceScreen at line 130. 1 of those changes was a fix/bug commit, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/LlamaApp.kt app/src/main/java/com/example/llamadroid/ui/LlamaApp.kt:192 — app/src/main/java/com/example/llamadroid/ui/LlamaApp.kt changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in LlamaAppKt.LlamaApp at line 192. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/LlamaApp.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:92 — app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in LLMSettingsScreenKt.LlmSettingsContent at line 92. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:848 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in AgentDialogsKt.AgentSettingsDialog at line 848. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt:193 — app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in SdCliSupportKt.buildSdCommandArgs at line 193. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/service/DownloadService.kt app/src/main/java/com/example/llamadroid/service/DownloadService.kt:565 — app/src/main/java/com/example/llamadroid/service/DownloadService.kt changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in DownloadService.startDownloadInternal at line 565. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/service/DownloadService.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:223 — app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in ModelManagerScreenKt.InstalledTab at line 223. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1908 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in LlamaClientService.streamNativeToolResponse at line 1908. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:261 — app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in ModelRepository.getModelDir at line 261. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:69 — app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in AudioTranscriptionScreenKt.AudioTranscriptionScreen at line 69. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt:99 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 155 in LlamaChatScreenKt.LlamaChatScreen at line 99. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:67 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in PDFToolboxScreenKt.PDFToolboxScreen at line 67. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt:479 — app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in LlamaServerChatService.performChatWithToolsStreaming at line 479. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:1507 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in NativeChatToolRuntime.executeToolCall at line 1507. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/harness/HarnessAgentRoute.kt app/src/main/java/com/example/llamadroid/harness/HarnessAgentRoute.kt:148 — app/src/main/java/com/example/llamadroid/harness/HarnessAgentRoute.kt changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 113 in HarnessAgentRouteKt.HarnessCapturedAgentRoute at line 148. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/harness/HarnessAgentRoute.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:99 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in HarnessScreenKt.NativeHarnessScreen at line 99. 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-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.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.
  • + 95 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×72
  • ClassTooLong: AgentService app/src/main/java/com/example/llamadroid/service/AgentService.kt:301 — ClassTooLong — 15551 significant lines (blank, comment-only and punctuation-only lines excluded), 159 methods. The bar is 400 significant lines; this is 15151 over it, 38.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: SettingsRepository app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:188 — ClassTooLong — 4082 significant lines (blank, comment-only and punctuation-only lines excluded), 542 methods. The bar is 400 significant lines; this is 3682 over it, 10.21× 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: AiToolServerService app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:139 — ClassTooLong — 3983 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 3583 over it, 9.96× 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: TamaGameEngine app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:64 — ClassTooLong — 3325 significant lines (blank, comment-only and punctuation-only lines excluded), 250 methods. The bar is 400 significant lines; this is 2925 over it, 8.31× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgentDirectReceiptTransition app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:249 — ClassTooLong — 2712 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 2312 over it, 6.78× 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: NativeChatToolRuntime app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:937 — ClassTooLong — 2071 significant lines (blank, comment-only and punctuation-only lines excluded), 67 methods. The bar is 400 significant lines; this is 1671 over it, 5.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ModelSourceRepository app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:177 — ClassTooLong — 1710 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 1310 over it, 4.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: LlamaService app/src/main/java/com/example/llamadroid/service/LlamaService.kt:68 — ClassTooLong — 1704 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 1304 over it, 4.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: StableDiffusionService app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:53 — ClassTooLong — 1679 significant lines (blank, comment-only and punctuation-only lines excluded), 99 methods. The bar is 400 significant lines; this is 1279 over it, 4.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DownloadService app/src/main/java/com/example/llamadroid/service/DownloadService.kt:145 — ClassTooLong — 1378 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 978 over it, 3.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgentWorkflowDao app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowDao.kt:12 — ClassTooLong — 1345 significant lines (blank, comment-only and punctuation-only lines excluded), 148 methods. The bar is 400 significant lines; this is 945 over it, 3.36× 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: ModelRepository app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:92 — ClassTooLong — 1337 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 937 over it, 3.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: WearRequestRouter app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:471 — ClassTooLong — 1275 significant lines (blank, comment-only and punctuation-only lines excluded), 92 methods. The bar is 400 significant lines; this is 875 over it, 3.19× 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: VideoGenerationService app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:50 — ClassTooLong — 1202 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods. The bar is 400 significant lines; this is 802 over it, 3.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: KnowledgeBaseRepository app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:158 — ClassTooLong — 1143 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 743 over it, 2.86× 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: WearCompanionStore wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:173 — ClassTooLong — 1057 significant lines (blank, comment-only and punctuation-only lines excluded), 98 methods. The bar is 400 significant lines; this is 657 over it, 2.64× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PendingAgentPreviewBlobDownload app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:118 — ClassTooLong — 1040 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 640 over it, 2.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MemoryFilePolicy app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:1318 — ClassTooLong — 1039 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 639 over it, 2.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ProcessController app/src/main/java/com/example/llamadroid/service/ProcessController.kt:49 — ClassTooLong — 1013 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 613 over it, 2.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DistributedService app/src/main/java/com/example/llamadroid/service/DistributedService.kt:83 — ClassTooLong — 996 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 596 over it, 2.49× 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: TamaAgentService app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:63 — ClassTooLong — 974 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 574 over it, 2.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DatasetProcessor app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:25 — ClassTooLong — 972 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 572 over it, 2.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.
  • ClassTooLong: HarnessRuntimeController app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:93 — ClassTooLong — 964 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 564 over it, 2.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DailyDreamMoment app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:51 — ClassTooLong — 953 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 553 over it, 2.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SdArtifactInspector app/src/main/java/com/example/llamadroid/sd/SdArtifactInspector.kt:39 — ClassTooLong — 935 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 535 over it, 2.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.
  • + 47 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×72
  • TooManyMethods: SettingsRepository app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:188 — TooManyMethods — 542 methods. The bar is 30 methods; this is 512 over it, 18.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Companion app/src/main/java/com/example/llamadroid/service/AgentService.kt:2738 — TooManyMethods — 293 methods. The bar is 30 methods; this is 263 over it, 9.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TamaGameEngine app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:64 — TooManyMethods — 250 methods. The bar is 30 methods; this is 220 over it, 8.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: ToolHttpServer app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:299 — TooManyMethods — 189 methods. The bar is 30 methods; this is 159 over it, 6.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: PDFService app/src/main/java/com/example/llamadroid/service/PDFService.kt:343 — TooManyMethods — 188 methods. The bar is 30 methods; this is 158 over it, 6.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: AgentService app/src/main/java/com/example/llamadroid/service/AgentService.kt:301 — TooManyMethods — 159 methods. The bar is 30 methods; this is 129 over it, 5.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: Companion app/src/main/java/com/example/llamadroid/service/DistributedService.kt:85 — TooManyMethods — 131 methods. The bar is 30 methods; this is 101 over it, 4.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: StableDiffusionService app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:53 — TooManyMethods — 99 methods. The bar is 30 methods; this is 69 over it, 3.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WearCompanionStore wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:173 — TooManyMethods — 98 methods. The bar is 30 methods; this is 68 over it, 3.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: WearRequestRouter app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:471 — TooManyMethods — 92 methods. The bar is 30 methods; this is 62 over it, 3.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LlamaClientService app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:199 — TooManyMethods — 91 methods. The bar is 30 methods; this is 61 over it, 3.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AgentDurableContractStore app/src/main/java/com/example/llamadroid/service/AgentDurableContractStore.kt:200 — TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NativeHarnessController app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:58 — TooManyMethods — 77 methods. The bar is 30 methods; this is 47 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AgentProjectControlPlane app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:256 — TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MangaTranslationSupport app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:409 — 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: NativeChatToolRuntime app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:937 — 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: BinaryRepository app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:106 — TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AdventureGateCatalog app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateCatalog.kt:8 — TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.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: AdventureGateCombatEngine app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateCombatEngine.kt:9 — TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.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: UnifiedNotificationManager app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:36 — TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LiteRtModelRepository app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:247 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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: AgentRuntimeSupport app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:1324 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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: VideoGenerationService app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:50 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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: AppDatabase app/src/main/java/com/example/llamadroid/data/db/AppDatabase.kt:195 — 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: LlamaRepository app/src/main/java/com/example/llamadroid/data/repository/LlamaRepository.kt:29 — 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.
  • + 47 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×71
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/data/db/RestoreCoordinator.kt:596 — app/src/main/java/com/example/llamadroid/data/db/RestoreCoordinator.kt:596-603 | app/src/main/java/com/example/llamadroid/util/DownloadResumeMetadata.kt:59-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/util/DownloadResumeMetadata.kt:59` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/data/model/CuratedBundleSupport.kt:210 — app/src/main/java/com/example/llamadroid/data/model/CuratedBundleSupport.kt:210-217 | app/src/main/java/com/example/llamadroid/data/model/StableAudioCuratedBundleCatalog.kt:26-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/model/CuratedBundleSupport.kt:210` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:2317 — app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:2317-2324 | app/src/main/java/com/example/llamadroid/service/KnowledgeBaseIndexingService.kt:381-388 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeProcess.kt:886 — app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeProcess.kt:886-893 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:493-500 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:20073 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:20073-20080 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:20141-20148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:20073` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:2472 — app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:2472-2479 | app/src/main/java/com/example/llamadroid/service/chat/ThinkingTags.kt:26-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:2472` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:978 — app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:978-985 | app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:1212-1219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:978` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/LiteRtTextGenerationClient.kt:184 — app/src/main/java/com/example/llamadroid/service/LiteRtTextGenerationClient.kt:184-191 | app/src/main/java/com/example/llamadroid/service/LiveTranslatorNativeRunner.kt:210-217 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LiteRtTextGenerationClient.kt:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:632 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:632-639 | app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:457-464 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt` and `app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:632` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3632 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3632-3639 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskRunner.kt:417-424 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3632` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaService.kt:1203 — app/src/main/java/com/example/llamadroid/service/LlamaService.kt:1203-1210 | app/src/main/java/com/example/llamadroid/service/LlamaService.kt:1231-1238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LlamaService.kt:1203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1630 — app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1630-1637 | app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1791-1798 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/NativeLlamaAudioSupport.kt:282 — app/src/main/java/com/example/llamadroid/service/NativeLlamaAudioSupport.kt:282-289 | app/src/main/java/com/example/llamadroid/service/WhisperService.kt:76-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/NativeLlamaAudioSupport.kt:282` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:1662 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:1662-1669 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:1705-1712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2540 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:2540-2547 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:6814-6821 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:2540` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:6416 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:6416-6423 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:6509-6516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:6416` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:729 — app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:729-736 | app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:805-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:729` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:841 — app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:841-848 | app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:1060-1067 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/SSHService.kt:343 — app/src/main/java/com/example/llamadroid/service/SSHService.kt:343-352 | app/src/main/java/com/example/llamadroid/service/SSHService.kt:831-838 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1414 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1414-1421 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1157-1164 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1414` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:416 — app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:416-423 | app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:747-754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:776 — app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:776-783 | app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:786-793 — both copies are in the same file, so extract the 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) app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:196 — app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:196-203 | app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:231-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4349 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4349-4356 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4484-4491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureScreen.kt:224 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureScreen.kt:224-232 | app/src/main/java/com/example/llamadroid/tama/ui/DungeonScreen.kt:79-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureScreen.kt:224` it begins part-way through the construct above it, so those 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.
  • + 46 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×53
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3ModelDoctor.kt:394 — app/src/main/java/com/example/llamadroid/audio/music/StableAudio3ModelDoctor.kt:394-402 | app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactGroups.kt:137-145 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/data/model/AudioModelSupport.kt:260 — app/src/main/java/com/example/llamadroid/data/model/AudioModelSupport.kt:260-268 | app/src/main/java/com/example/llamadroid/data/model/CuratedBundleSupport.kt:303-311 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/data/model/AudioModelSupport.kt:258` calls `payloadArtifactIdentity` and `app/src/main/java/com/example/llamadroid/data/model/CuratedBundleSupport.kt:302` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:681 — app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:681-689 | app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:748-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 `app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:681` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:271 — app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:271-279 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeEnvironment.kt:342-350 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:271` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeEnvironment.kt:351` calls `require`, `startsWith` and `app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:280` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:67 — app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:67-75 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:975-983 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:244 — app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:244-252 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:1177-1185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:765 — app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:765-773 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:837-845 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:765` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:572 — app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:572-580 | app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:694-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 `app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:572` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:897 — app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:897-905 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1003-1011 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:897` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:446 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:446-454 | app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:306-318 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt` and `app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:446` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2374 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:2374-2382 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:2418-2426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:2374` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:7042 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:7042-7050 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:7118-7126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:7042` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:775 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:775-783 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1008-1016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:775` it begins part-way through the construct above it, so those 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 `config` to `SDConfig` in one and `SDUpscaleConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:899 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:899-907 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1123-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 (9 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2149 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2149-2157 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2173-2181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2149` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:349 — app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:349-357 | app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:413-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:349` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:650 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:650-658 | app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:661-669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:412 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:412-420 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:450-458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:412` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:746 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:746-754 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4021-4029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:746` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:755` calls `Spacer`, `height` and `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4031` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:759 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:759-767 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4034-4042 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:759` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4080 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4080-4088 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4099-4107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4080` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentNewProjectDialog.kt:61 — app/src/main/java/com/example/llamadroid/ui/agent/AgentNewProjectDialog.kt:61-71 | app/src/main/java/com/example/llamadroid/ui/agent/AgentPlanEditorDialog.kt:53-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentNewProjectDialog.kt:61` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRootfsFileBrowser.kt:329 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRootfsFileBrowser.kt:329-337 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRootfsFileBrowser.kt:401-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 `app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRootfsFileBrowser.kt:329` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/AIHubScreen.kt:290 — app/src/main/java/com/example/llamadroid/ui/ai/AIHubScreen.kt:290-298 | app/src/main/java/com/example/llamadroid/ui/ai/AIHubScreen.kt:315-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/AIHubScreen.kt:290` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:3789 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:3789-3797 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1337-1345 — 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.
  • + 28 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×44
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:489 — app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:489-500 | app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:525-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:489` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactFinalizer.kt:528 — app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactFinalizer.kt:528-539 | app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:2178-2189 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactFinalizer.kt:528` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactLifecycle.kt:101 — app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactLifecycle.kt:101-112 | app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactLifecycle.kt:144-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactLifecycle.kt:141` calls `suspend` and `app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactLifecycle.kt:98` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:880 — app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:880-891 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:903-914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:880` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentLocalProjectRunner.kt:461 — app/src/main/java/com/example/llamadroid/service/AgentLocalProjectRunner.kt:461-472 | app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:284-295 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentLocalProjectRunner.kt:461` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:2221 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:2221-2232 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:2292-2303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:20611 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:20611-20622 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:20733-20744 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:20611` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:487 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:487-498 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2842-2853 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:487` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/service/DownloadService.kt:988 — app/src/main/java/com/example/llamadroid/service/DownloadService.kt:988-999 | app/src/main/java/com/example/llamadroid/service/DownloadService.kt:1127-1138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/DownloadService.kt:988` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:249 — app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:249-260 | app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:279-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:249` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskService.kt:380 — app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskService.kt:380-391 | app/src/main/java/com/example/llamadroid/service/NativeChatLocalServerStarter.kt:200-211 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskService.kt:380` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1226 — app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1226-1237 | app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1354-1365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1226` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1546 — app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1546-1557 | app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1731-1742 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1546` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:921 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:921-932 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:946-957 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:921` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:959` calls `readLine` and `app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:933` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1142 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1142-1153 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1166-1177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1142` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1179` calls `readLine` and `app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1154` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:554 — app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:554-565 | app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:579-590 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:554` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaMapView.kt:320 — app/src/main/java/com/example/llamadroid/tama/ui/TamaMapView.kt:320-331 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:2132-2143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaMapView.kt:320` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:1538 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:1538-1549 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:1559-1570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:1559` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5574 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5574-5588 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5682-5693 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5574` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentSkillManager.kt:300 — app/src/main/java/com/example/llamadroid/ui/agent/AgentSkillManager.kt:300-311 | app/src/main/java/com/example/llamadroid/ui/agent/AgentSkillManager.kt:338-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentSkillManager.kt:300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeTransfer.kt:939 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeTransfer.kt:939-950 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeTransfer.kt:962-973 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeTransfer.kt:939` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnActions.kt:244 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnActions.kt:244-255 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnActions.kt:261-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/DatasetScreen.kt:184 — app/src/main/java/com/example/llamadroid/ui/ai/DatasetScreen.kt:184-196 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3563-3574 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/DatasetScreen.kt:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/GenerationOptionGuides.kt:107 — app/src/main/java/com/example/llamadroid/ui/ai/GenerationOptionGuides.kt:107-118 | app/src/main/java/com/example/llamadroid/ui/ai/GenerationOptionGuides.kt:169-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/GenerationOptionGuides.kt:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4476 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4476-4487 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:955-966 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4476` 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.
  • + 19 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×44
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:746 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:746-752 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:494-500 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt` and `app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:719 — app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:719-725 | app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:1114-1120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:718` calls `trim`, `uppercase` and `app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:1113` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:453 — app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:453-459 | app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:671-677 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:451` calls `randomUUID`, `toString`, `currentTimeMillis` and `app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:670` 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 (7 lines × 2) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:822 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:822-828 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:913-919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt: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 (7 lines × 2) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:888 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:888-894 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:1662-1668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaService.kt:1081 — app/src/main/java/com/example/llamadroid/service/LlamaService.kt:1081-1087 | app/src/main/java/com/example/llamadroid/service/LlamaService.kt:1541-1547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LlamaService.kt:1081` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:826 — app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:826-832 | app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:1045-1051 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:826` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:735 — app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:735-741 | app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:959-965 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:735` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2245 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2245-2251 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2267-2273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:342 — app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:342-348 | app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:403-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:411` calls `AdventureGatePurchaseResult` and `app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:349` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:369 — app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:369-375 | app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:1255-1261 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:369` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2191 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2191-2197 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2316-2322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCatalog.kt:79 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCatalog.kt:79-85 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCatalog.kt:224-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCatalog.kt:79` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1573 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1573-1579 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1782-1788 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1573` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessFormatting.kt:64 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessFormatting.kt:64-70 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessFormatting.kt:78-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessFormatting.kt:64` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessPluginActions.kt:124 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessPluginActions.kt:124-131 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessPluginActions.kt:142-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessPluginActions.kt:124` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:177 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:177-183 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:62-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:437 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:437-443 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageMedia.kt:641-654 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:437` 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 (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:867 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:867-873 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:936-942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:867` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/QuadtrixTrainerScreen.kt:178 — app/src/main/java/com/example/llamadroid/ui/ai/QuadtrixTrainerScreen.kt:178-184 | app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:106-112 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/QuadtrixTrainerScreen.kt:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:297 — app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:297-303 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:679-696 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:297` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4101 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4101-4107 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4142-4148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/RemoteServerForm.kt:541 — app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/RemoteServerForm.kt:541-547 | app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/RemoteServerForm.kt:693-699 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/RemoteServerForm.kt:541` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:100 — app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:100-108 | app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:268-274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1796 — app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1796-1803 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1206-1212 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1796` it does not close everything it opens, so those 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.
  • + 19 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×43
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxBackgroundRemovalSupport.kt:550 — app/src/main/java/com/example/llamadroid/onnx/OnnxBackgroundRemovalSupport.kt:550-555 | app/src/main/java/com/example/llamadroid/onnx/OnnxBackgroundRemovalSupport.kt:561-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/onnx/OnnxBackgroundRemovalSupport.kt:550` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentLocalProjectRunner.kt:90 — app/src/main/java/com/example/llamadroid/service/AgentLocalProjectRunner.kt:90-95 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:2540-2545 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:8476 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:8476-8481 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:20426-20432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:9742 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:9742-9747 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:9930-9935 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:9742` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:969 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:969-974 | app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:467-472 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:464` calls `optString` and `app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:967` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:3624 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:3624-3629 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3544-3549 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3568 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3568-3574 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskRunner.kt:430-435 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3568` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1670 — app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1670-1675 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:4378-4383 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1670` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1676` calls `isNotBlank` and `app/src/main/java/com/example/llamadroid/service/PDFService.kt:4384` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1246 — app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1246-1251 | app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1374-1379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1246` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:5660 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:5660-5665 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:5729-5734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:5660` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:464 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:464-469 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:561-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:464` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/delegation/DelegationFileBridge.kt:150 — app/src/main/java/com/example/llamadroid/service/delegation/DelegationFileBridge.kt:150-155 | app/src/main/java/com/example/llamadroid/service/delegation/DelegationProjectFiles.kt:225-230 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmScreen.kt:98 — app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmScreen.kt:98-103 | app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3901-3906 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2393 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2393-2398 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:537-542 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2393` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:371 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:371-376 | app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:551-559 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:371` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:1307 — app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:1307-1312 | app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkScreen.kt:426-433 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:1307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4094 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4094-4099 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4811-4816 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4094` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4543 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4543-4548 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5236-5241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4543` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6648 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6648-6653 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7211-7216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6648` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryScreen.kt:1611 — app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryScreen.kt:1611-1619 | app/src/main/java/com/example/llamadroid/ui/models/ModelPromotionDialog.kt:167-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryScreen.kt:1611` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:1487 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:1487-1492 | app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:793-798 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:1487` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/harness/HarnessAgentRoute.kt:944 — app/src/main/java/com/example/llamadroid/harness/HarnessAgentRoute.kt:944-949 | app/src/main/java/com/example/llamadroid/harness/HarnessAgentRoute.kt:969-974 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/harness/HarnessAgentRoute.kt:944` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2710 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2710-2715 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2798-2803 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2710` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:259 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:259-264 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskService.kt:57-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2841 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2841-2846 | app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:1290-1295 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2841` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 18 more in this group — see findings.md.
DM11 · Constructible invalid state · Constructible in an invalid state · ×40
  • Constructible in an invalid state: AudioVoiceProfileEntity app/src/main/java/com/example/llamadroid/audio/AudioEntities.kt:20 — `AudioVoiceProfileEntity`'s public constructor takes `id`, `name`, `language`, `originalPath`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AudioVoiceProfileEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AudioGenerationJobEntity app/src/main/java/com/example/llamadroid/audio/AudioEntities.kt:86 — `AudioGenerationJobEntity`'s public constructor takes `id`, `adapterId`, `family`, `modelId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AudioGenerationJobEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AudioLibraryFolderEntity app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryEntities.kt:19 — `AudioLibraryFolderEntity`'s public constructor takes `id`, `name`, `parentId` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AudioLibraryFolderEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AudioLibraryItemEntity app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryEntities.kt:37 — `AudioLibraryItemEntity`'s public constructor takes `id`, `originKey`, `title`, `audioPath`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AudioLibraryItemEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AudioLibraryPreferencesEntity app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryEntities.kt:58 — `AudioLibraryPreferencesEntity`'s public constructor takes `id`, `query`, `sort`, `folderId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AudioLibraryPreferencesEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentConversationEntity app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:19 — `AgentConversationEntity`'s public constructor takes `title`, `projectFolder`, `resumeState`, `lastStopReason`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentConversationEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentProjectFolderEntity app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:71 — `AgentProjectFolderEntity`'s public constructor takes `name` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProjectFolderEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentMessageEntity app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:98 — `AgentMessageEntity`'s public constructor takes `originalId`, `role`, `content`, `imagePath`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentMessageEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentProjectRunEntity app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:144 — `AgentProjectRunEntity`'s public constructor takes `projectFolder`, `backend`, `prootEnvironmentId`, `runtime`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProjectRunEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentProotEnvironmentEntity app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:183 — `AgentProotEnvironmentEntity`'s public constructor takes `id`, `displayName`, `storageKey`, `imageId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProotEnvironmentEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentProotRunEntity app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:261 — `AgentProotRunEntity`'s public constructor takes `id`, `environmentId`, `projectFolder`, `commandDigest`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProotRunEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentProjectEventEntity app/src/main/java/com/example/llamadroid/data/db/AgentChatEntities.kt:313 — `AgentProjectEventEntity`'s public constructor takes `projectFolder`, `category`, `eventType`, `phase`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProjectEventEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentRuntimeEndpointConfigEntity app/src/main/java/com/example/llamadroid/data/db/AgentRuntimeEndpointConfigEntity.kt:21 — `AgentRuntimeEndpointConfigEntity`'s public constructor takes `name`, `backend`, `baseUrl`, `defaultModel` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentRuntimeEndpointConfigEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentRuntimeProfileEntity app/src/main/java/com/example/llamadroid/data/db/AgentRuntimeProfileEntity.kt:19 — `AgentRuntimeProfileEntity`'s public constructor takes `agentKey`, `backend`, `model` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentRuntimeProfileEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentMessagePartEntity app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:34 — `AgentMessagePartEntity`'s public constructor takes `id`, `messageOriginalId`, `type`, `status`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentMessagePartEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentTurnContextEntity app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:75 — `AgentTurnContextEntity`'s public constructor takes `rootTurnId`, `agentKey`, `status`, `backend`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentTurnContextEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentSkillEntity app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:111 — `AgentSkillEntity`'s public constructor takes `id`, `name`, `description`, `version`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentSkillEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentSkillAssignmentEntity app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:143 — `AgentSkillAssignmentEntity`'s public constructor takes `skillId`, `agentKey`, `permission` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentSkillAssignmentEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentPendingQuestionEntity app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:168 — `AgentPendingQuestionEntity`'s public constructor takes `id`, `rootTurnId`, `agentSessionId`, `toolCallId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentPendingQuestionEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentPendingPlanEntity app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:215 — `AgentPendingPlanEntity`'s public constructor takes `id`, `rootTurnId`, `agentSessionId`, `planMessageId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentPendingPlanEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentTodoEntity app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:254 — `AgentTodoEntity`'s public constructor takes `id`, `text`, `status`, `priority`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentTodoEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentCompactionEntity app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:295 — `AgentCompactionEntity`'s public constructor takes `id`, `rootTurnId`, `summaryText`, `focus`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentCompactionEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentProjectStateEntity app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:336 — `AgentProjectStateEntity`'s public constructor takes `mode`, `currentGoal`, `activePlanVersionId`, `currentPhaseId`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentProjectStateEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentPlanVersionEntity app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:377 — `AgentPlanVersionEntity`'s public constructor takes `id`, `sourcePendingPlanId`, `summary`, `planMarkdown`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentPlanVersionEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AgentWorkReportEntity app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowEntities.kt:410 — `AgentWorkReportEntity`'s public constructor takes `id`, `invocationId`, `todoId`, `agentRole`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AgentWorkReportEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×39
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:4409 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:4409-4413 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:4445-4449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:4409` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1509 — app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1509-1513 | app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1694-1698 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2761 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:2761-2765 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:4335-4339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:2761` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:657 — app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:657-661 | app/src/main/java/com/example/llamadroid/service/VideoRecognitionWhisperTranscriber.kt:211-215 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/service/delegation/DelegationStatusFormatter.kt:24 — app/src/main/java/com/example/llamadroid/service/delegation/DelegationStatusFormatter.kt:24-28 | app/src/main/java/com/example/llamadroid/service/filestation/FileStationSettingsStore.kt:150-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/delegation/DelegationStatusFormatter.kt:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/TamaArcadeSessions.kt:121 — app/src/main/java/com/example/llamadroid/tama/game/TamaArcadeSessions.kt:121-125 | app/src/main/java/com/example/llamadroid/tama/game/TamaArcadeSessions.kt:180-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCustomProviderPanel.kt:348 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCustomProviderPanel.kt:348-352 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProviderDiscoveryPanel.kt:46-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCustomProviderPanel.kt:348` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProviderCreation.kt:278 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProviderCreation.kt:278-284 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProviderDiscovery.kt:45-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:206 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:206-210 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:216-220 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:206` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:211` calls `modelDao`, `getModelsByType`, `collectAsState` and `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:221` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:326 — app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:326-334 | app/src/main/java/com/example/llamadroid/ui/ai/MangaPaintedMaskEditor.kt:506-510 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:326` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:696 — app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:696-700 | app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:1441-1445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:696` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3753 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3753-3757 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2596-2604 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3753` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2605` calls `IconButton`, `Icon`, `stringResource` and `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3758` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:846 — app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:846-850 | app/src/main/java/com/example/llamadroid/ui/models/ModelClassificationOverrideUi.kt:63-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:846` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:169 — app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:169-173 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:248-254 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:1811 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:1811-1815 | app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:728-732 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1619 — app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1619-1623 | app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:1286-1290 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/harness/HarnessRecoveryFileServer.kt:495 — app/src/main/java/com/example/llamadroid/harness/HarnessRecoveryFileServer.kt:495-499 | app/src/main/java/com/example/llamadroid/service/AiServerSupport.kt:233-237 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:709 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:709-713 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:462-466 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt` and `app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:3726 — app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:3726-3730 | app/src/main/java/com/example/llamadroid/service/AgentPromptBudget.kt:610-614 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:528 — app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:528-532 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:1966-1970 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/widget/HomeWidgets.kt:384 — app/src/main/java/com/example/llamadroid/widget/HomeWidgets.kt:384-388 | app/src/main/java/com/example/llamadroid/widget/NoteDisplayWidget.kt:152-156 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:445 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:445-449 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:532-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:445` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3Models.kt:314 — app/src/main/java/com/example/llamadroid/audio/music/StableAudio3Models.kt:314-318 | app/src/main/java/com/example/llamadroid/audio/music/StableAudio3Models.kt:324-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/audio/music/StableAudio3Models.kt:324` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:370 — app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:370-374 | app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:387-391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:370` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SubtitleBurnScreen.kt:326 — app/src/main/java/com/example/llamadroid/ui/ai/SubtitleBurnScreen.kt:326-330 | app/src/main/java/com/example/llamadroid/ui/ai/SubtitleBurnScreen.kt:360-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SubtitleBurnScreen.kt:326` 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.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×37
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMerge.kt:560 — app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMerge.kt:560-570 | app/src/main/java/com/example/llamadroid/audio/music/StableAudio3SafeTensors.kt:247-257 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMerge.kt:560` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1316 — app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1316-1326 | app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1458-1468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1316` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt:261 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt:261-271 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:562-572 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt: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 (11 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:511 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:511-521 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:327-337 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt` and `app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:511` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:266 — app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:266-276 | app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:281-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:7951 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:7951-7961 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:7998-8008 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:11668 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:11668-11678 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11697-11707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:470 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:470-480 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:589-599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:600` calls `randomUUID`, `toString` and `app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:481` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2530 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:2530-2540 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:2786-2796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:2530` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:5344 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:5344-5354 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:5432-5442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:5344` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:850 — app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:850-860 | app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:1069-1079 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:850` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:263 — app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:263-273 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1316-1326 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:263` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1155 — app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1155-1165 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1174-1184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1155` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/tama/adventure/AdventureService.kt:587 — app/src/main/java/com/example/llamadroid/tama/adventure/AdventureService.kt:587-597 | app/src/main/java/com/example/llamadroid/tama/adventure/AdventureService.kt:647-657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/adventure/AdventureService.kt:587` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:746 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:746-756 | app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:847-857 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:107 — app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:107-117 | app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:124-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:1264 — app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:1264-1274 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageItem.kt:204-214 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:1264` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:227 — app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:227-237 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageMedia.kt:634-646 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageMedia.kt:634` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:464 — app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:464-475 | app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:613-623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:464` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/GenerationOptionGuides.kt:120 — app/src/main/java/com/example/llamadroid/ui/ai/GenerationOptionGuides.kt:120-130 | app/src/main/java/com/example/llamadroid/ui/ai/GenerationOptionGuides.kt:182-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/GenerationOptionGuides.kt:120` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4789 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4789-4799 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1879-1889 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1877` calls `fromStoredValue` and `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4788` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/OnnxTtsScreen.kt:364 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxTtsScreen.kt:364-374 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1495-1505 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/OnnxTtsScreen.kt:364` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1125 — app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1125-1135 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1143-1153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1125` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:647 — app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:647-657 | app/src/main/java/com/example/llamadroid/ui/ai/VideoUpscalerScreen.kt:533-543 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:647` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2111 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2111-2121 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:963-973 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • + 12 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×36
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1032 — app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1032-1041 | app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1063-1072 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1032` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:164 — app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:164-173 | app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:181-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:256 — app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:256-265 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:1187-1196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:861 — app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:861-870 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:883-894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:861` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:2447 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:2447-2456 | app/src/main/java/com/example/llamadroid/service/SSHService.kt:302-311 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:14821 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:14821-14830 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:14929-14938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:20653 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:20653-20662 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:20773-20782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:20653` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3776 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3776-3785 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3863-3872 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:346 — app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:346-355 | app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:408-417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:346` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:3670 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:3670-3679 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:4137-4146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:3670` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:6923 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:6923-6932 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:7188-7197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:6923` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:146 — app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:146-155 | app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:187-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:146` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:628 — app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:628-637 | app/src/main/java/com/example/llamadroid/service/VideoRecognitionWhisperTranscriber.kt:184-193 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:628` it begins part-way through the construct above it, so those 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, `app/src/main/java/com/example/llamadroid/service/VideoRecognitionWhisperTranscriber.kt:183` calls `environment`, `putAll` and `app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:627` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/service/bubble/ChatBubbleOverlayService.kt:185 — app/src/main/java/com/example/llamadroid/service/bubble/ChatBubbleOverlayService.kt:185-194 | app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiOverlayService.kt:465-474 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/PetMapper.kt:67 — app/src/main/java/com/example/llamadroid/tama/game/PetMapper.kt:67-76 | app/src/main/java/com/example/llamadroid/tama/game/PetMapper.kt:140-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:610 — app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:610-619 | app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:1319-1328 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:610` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmCoinPop.kt:55 — app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmCoinPop.kt:55-64 | app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmTileOverlay.kt:235-244 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmCoinPop.kt:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmMaterialUi.kt:160 — app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmMaterialUi.kt:160-169 | app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmTileOverlay.kt:229-238 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmMaterialUi.kt:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:252 — app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:252-261 | app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:326-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:252` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1430 — app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1430-1439 | app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1492-1501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1430` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1692 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1692-1701 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1714-1723 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1714` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:120 — app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:120-129 | app/src/main/java/com/example/llamadroid/ui/ai/MangaPaintedMaskEditor.kt:184-193 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:120` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:256 — app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:256-270 | app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:804-813 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt` and `app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:256` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:469 — app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:469-478 | app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:496-505 — both copies are in the same file, so extract the 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 (10 lines × 2) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:916 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:916-925 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1027-1036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:916` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1026` calls `Spacer`, `height` and `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:914` 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.
  • + 11 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×35
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1555 — app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1555-1569 | app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1574-1588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1555` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:18224 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:18224-18238 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:18264-18278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:18224` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:344 — app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:344-358 | app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:369-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:344` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:474 — app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:474-488 | app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:492-506 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:490` calls `optString` and `app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:472` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:243 — app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:243-257 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1297-1311 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:243` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1327 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1327-1341 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:756-770 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:635 — app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:635-649 | app/src/main/java/com/example/llamadroid/service/VideoReusePayload.kt:538-552 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:315 — app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:315-329 | app/src/main/java/com/example/llamadroid/service/chat/NativeChatVideoSupport.kt:722-736 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/service/chat/NativeChatCitations.kt:97 — app/src/main/java/com/example/llamadroid/service/chat/NativeChatCitations.kt:97-111 | app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:799-813 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1054 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1054-1068 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1231-1245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1514 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1514-1528 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3437-3451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1514` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:166 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:166-180 | app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:212-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:166` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:472 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:472-486 | app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:525-539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:471` calls `isLlamaSwapBackend` and `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:523` 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) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:528 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:528-542 | app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:587-601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:528` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:543` calls `verticalScroll`, `rememberScrollState` and `app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:602` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:430 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:430-444 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:467-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt: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 (15 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/DatasetScreen.kt:119 — app/src/main/java/com/example/llamadroid/ui/ai/DatasetScreen.kt:119-133 | app/src/main/java/com/example/llamadroid/ui/models/ModelShareScreen.kt:300-314 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/DatasetScreen.kt:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1950 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1950-1964 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:290-304 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1950` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2244 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2244-2258 | app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:318-332 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4434 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4434-4448 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5131-5145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4434` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1321 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1321-1335 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsControls.kt:169-183 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1321` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsSheet.kt:48 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsSheet.kt:48-62 | app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/ServerPickerSheet.kt:82-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsSheet.kt:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt:920 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt:920-934 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt:1019-1033 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt:920` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:2056 — app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:2056-2070 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:656-670 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:2056` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1410 — app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1410-1424 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1745-1759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1410` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:122 — app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:122-137 | app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:172-186 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:122` 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.
  • + 10 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×35
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1988 — app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1988-2000 | app/src/main/java/com/example/llamadroid/sd/SdArtifactInspector.kt:1208-1220 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1988` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1004 — app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1004-1016 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1202-1214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2939 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:2939-2951 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:3102-3114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:2939` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:7022 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:7022-7034 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:7095-7107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:7022` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFSummaryService.kt:189 — app/src/main/java/com/example/llamadroid/service/PDFSummaryService.kt:189-201 | app/src/main/java/com/example/llamadroid/service/VideoSumupService.kt:604-616 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFSummaryService.kt:189` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1105 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1105-1117 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1270-1282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:179 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:179-191 | app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:928-940 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5065 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5065-5077 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5099-5111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5065` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDirectStatusCard.kt:65 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDirectStatusCard.kt:65-77 | app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:258-270 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDirectStatusCard.kt:65` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1489 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1489-1501 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1523-1535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1489` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2607 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2607-2619 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:1004-1016 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2607` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4308 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4308-4320 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:755-767 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:578 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:578-590 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:1259-1271 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:578` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:593 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:593-605 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxTtsScreen.kt:376-388 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:593` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SdIpAdapterControls.kt:362 — app/src/main/java/com/example/llamadroid/ui/ai/SdIpAdapterControls.kt:362-374 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatListScreen.kt:1151-1163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SdIpAdapterControls.kt:362` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3490 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3490-3502 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3514-3526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3490` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4111 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4111-4123 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4152-4164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4111` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatListScreen.kt:1052 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatListScreen.kt:1052-1064 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatListScreen.kt:1262-1274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatListScreen.kt:1052` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:898 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:898-910 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:931-943 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:898` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/components/AppChrome.kt:143 — app/src/main/java/com/example/llamadroid/ui/components/AppChrome.kt:143-155 | app/src/main/java/com/example/llamadroid/ui/components/ResponsiveComponents.kt:194-206 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/components/AppChrome.kt:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:85 — app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:85-97 | app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:253-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/components/SharedSettingsComponents.kt:31 — app/src/main/java/com/example/llamadroid/ui/components/SharedSettingsComponents.kt:31-43 | app/src/main/java/com/example/llamadroid/ui/components/SharedSettingsComponents.kt:79-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/components/SharedSettingsComponents.kt:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3122 — app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3122-3134 | app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3240-3252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3122` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3120` calls `Text`, `stringResource` and `app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3238` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3249 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3249-3261 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3447-3459 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3263` calls `LabeledTextField` and `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3460` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:786 — app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:786-798 | app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:1136-1148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:786` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 10 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×30
  • Edited copy of a member (9 corresponding lines) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2208 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2208-2217 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2773-2781 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/service/delegation/DelegateHarnessSupport.kt:44 — app/src/main/java/com/example/llamadroid/service/delegation/DelegateHarnessSupport.kt:44-52 | app/src/main/java/com/example/llamadroid/service/delegation/DelegationFileBridge.kt:71-79 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3310 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3310-3318 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3320-3328 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessBridgeOperations.kt:770 — app/src/main/java/com/example/llamadroid/harness/HarnessBridgeOperations.kt:770-780 | app/src/main/java/com/example/llamadroid/harness/HarnessWorkspaceAccess.kt:361-369 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2739 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2739-2747 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:3382-3390 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/harness/RoomHarnessRuntimeStore.kt:44 — app/src/main/java/com/example/llamadroid/harness/RoomHarnessRuntimeStore.kt:44-55 | app/src/main/java/com/example/llamadroid/harness/RoomHarnessRuntimeStore.kt:57-65 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferClient.kt:82 — app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferClient.kt:82-90 | app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferClient.kt:105-113 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:130 — app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:130-138 | app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:140-149 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:2316 — app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:2316-2324 | app/src/main/java/com/example/llamadroid/service/KnowledgeBaseIndexingService.kt:380-388 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt:173 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt:173-181 | app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:409-423 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:746 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:746-754 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:6386-6394 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:775 — app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:775-783 | app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:785-793 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:208 — app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:208-216 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessExtensionsPanels.kt:973-987 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/OnnxTtsScreen.kt:559 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxTtsScreen.kt:559-567 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:749-761 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4329 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4329-4337 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3394-3402 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:68 — app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:68-76 | app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:87-96 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/service/AiServerSupport.kt:314 — app/src/main/java/com/example/llamadroid/service/AiServerSupport.kt:314-322 | app/src/main/java/com/example/llamadroid/service/AiServerSupport.kt:324-333 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2591 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2591-2599 | app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2602-2611 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:639 — app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:639-647 | app/src/main/java/com/example/llamadroid/service/LiteRtGpuDiagnostics.kt:487-495 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1866 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1866-1874 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1975-1983 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/data/db/RestoreCoordinator.kt:595 — app/src/main/java/com/example/llamadroid/data/db/RestoreCoordinator.kt:595-603 | app/src/main/java/com/example/llamadroid/service/SdInpaintImageCompositor.kt:109-120 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentHarnessPolicy.kt:101 — app/src/main/java/com/example/llamadroid/service/AgentHarnessPolicy.kt:101-109 | app/src/main/java/com/example/llamadroid/service/AgentHarnessPolicy.kt:120-128 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5402 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5402-5414 | app/src/main/java/com/example/llamadroid/service/SdInpaintImageCompositor.kt:99-107 — 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) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:592 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:592-600 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:602-610 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentProotTerminalSessionManager.kt:488 — app/src/main/java/com/example/llamadroid/service/AgentProotTerminalSessionManager.kt:488-497 | app/src/main/java/com/example/llamadroid/service/HarnessRecoveryTerminalSessionManager.kt:380-388 — 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.
  • + 5 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×29
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:749 — app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:749-762 | app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:974-987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentProotTerminalSessionManager.kt:589 — app/src/main/java/com/example/llamadroid/service/AgentProotTerminalSessionManager.kt:589-602 | app/src/main/java/com/example/llamadroid/service/HarnessRecoveryTerminalSessionManager.kt:467-480 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentProotTerminalSessionManager.kt:589` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:7102 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:7102-7115 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:7512-7525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:7102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:947 — app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:947-960 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1059-1072 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:947` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1073` calls `log` and `app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:961` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:396 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:396-409 | app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:471-484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:396` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:100 — app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:100-113 | app/src/main/java/com/example/llamadroid/service/ZimShareService.kt:92-105 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/service/ModelShareService.kt` and `app/src/main/java/com/example/llamadroid/service/ZimShareService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/service/NativeChatOnnxImageGenerator.kt:63 — app/src/main/java/com/example/llamadroid/service/NativeChatOnnxImageGenerator.kt:63-76 | app/src/main/java/com/example/llamadroid/service/NativeChatOnnxImageGenerator.kt:103-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2084 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2084-2097 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2222-2235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2084` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2073 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2073-2086 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1493-1506 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2094 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2094-2107 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1514-1527 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4230 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4230-4243 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4657-4670 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4657` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureSettingsDialog.kt:158 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureSettingsDialog.kt:158-171 | app/src/main/java/com/example/llamadroid/tama/ui/TamaSettingsDialog.kt:167-180 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureSettingsDialog.kt:158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:330 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:330-343 | app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:439-452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:330` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmDroneDialogs.kt:98 — app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmDroneDialogs.kt:98-111 | app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmDroneDialogs.kt:238-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmDroneDialogs.kt:98` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1444 — app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1444-1458 | app/src/main/java/com/example/llamadroid/ui/components/DownloadTaskSection.kt:196-209 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1444` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:510 — app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:510-523 | app/src/main/java/com/example/llamadroid/ui/ai/VideoUpscalerScreen.kt:313-326 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:510` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/VideoUpscalerScreen.kt:312` calls `consumeWindowInsets` and `app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:509` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2254 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2254-2267 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:936-949 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2254` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:542 — app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:542-555 | app/src/main/java/com/example/llamadroid/ui/ai/VideoUpscalerScreen.kt:465-478 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:542` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:494 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:494-507 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:509-522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1127 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1127-1140 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1295-1308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatContextGauge.kt:129 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatContextGauge.kt:129-142 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsSections.kt:856-869 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:115 — app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:115-128 | app/src/main/java/com/example/llamadroid/ui/easy/EasyChatOptionsSheet.kt:121-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:115` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4561 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4561-4574 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4605-4618 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4561` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1207 — app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1207-1220 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1666-1679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1207` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:349 — app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:349-362 | app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:452-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:349` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×24
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3359 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3359-3369 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2897-2906 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkHistoryScreen.kt:638 — app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkHistoryScreen.kt:638-648 | app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkHistoryScreen.kt:791-800 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt:77 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt:77-86 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt:94-103 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/AiServersHubScreen.kt:976 — app/src/main/java/com/example/llamadroid/ui/ai/AiServersHubScreen.kt:976-985 | app/src/main/java/com/example/llamadroid/ui/distributed/WorkerModeScreen.kt:1085-1099 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2976 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2976-2985 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2987-2996 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1060 — app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1060-1069 | app/src/main/java/com/example/llamadroid/service/PDFTranslationLogic.kt:370-379 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/compaction/NativeChatTurnDecoratorLogic.kt:98 — app/src/main/java/com/example/llamadroid/service/compaction/NativeChatTurnDecoratorLogic.kt:98-114 | app/src/main/java/com/example/llamadroid/service/delegation/DelegateSubagentMessages.kt:52-61 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/data/model/CuratedBundleSupport.kt:208 — app/src/main/java/com/example/llamadroid/data/model/CuratedBundleSupport.kt:208-217 | app/src/main/java/com/example/llamadroid/data/model/StableAudioCuratedBundleCatalog.kt:24-33 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaServerUsageLease.kt:43 — app/src/main/java/com/example/llamadroid/service/LlamaServerUsageLease.kt:43-52 | app/src/main/java/com/example/llamadroid/service/LlamaServerUsageLease.kt:55-64 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/filestation/api/ArchiveApi.kt:64 — app/src/main/java/com/example/llamadroid/service/filestation/api/ArchiveApi.kt:64-73 | app/src/main/java/com/example/llamadroid/service/filestation/api/FsWriteApi.kt:50-59 — 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) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:365 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:365-375 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:377-386 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:904 — app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:904-913 | app/src/main/java/com/example/llamadroid/service/AgentWebSearchSupport.kt:177-188 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:228 — app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:228-237 | app/src/main/java/com/example/llamadroid/service/ZimShareService.kt:204-213 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessAtomicFile.kt:58 — app/src/main/java/com/example/llamadroid/harness/HarnessAtomicFile.kt:58-67 | app/src/main/java/com/example/llamadroid/harness/HarnessSessionAtomicFile.kt:77-86 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessProviderErrorCodes.kt:69 — app/src/main/java/com/example/llamadroid/harness/HarnessProviderErrorCodes.kt:69-78 | app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:118-131 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:188 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:188-197 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskService.kt:480-489 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2882 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2882-2891 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2896-2905 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:4315 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:4315-4324 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:4326-4335 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaOcrExclusiveLease.kt:175 — app/src/main/java/com/example/llamadroid/service/LlamaOcrExclusiveLease.kt:175-184 | app/src/main/java/com/example/llamadroid/service/perf/LockedScreenReport.kt:23-34 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:999 — app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:999-1008 | app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:1011-1021 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessRemoteProjectRunner.kt:509 — app/src/main/java/com/example/llamadroid/harness/HarnessRemoteProjectRunner.kt:509-518 | app/src/main/java/com/example/llamadroid/harness/HarnessSshProcesses.kt:139-148 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2015 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2015-2024 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1427-1436 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentDurableContractStore.kt:710 — app/src/main/java/com/example/llamadroid/service/AgentDurableContractStore.kt:710-722 | app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:685-694 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentDurableContractStore.kt:787 — app/src/main/java/com/example/llamadroid/service/AgentDurableContractStore.kt:787-799 | app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:900-909 — 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×23
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/MainActivity.kt:308 — `catch (_: RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/MainActivity.kt:322 — `catch (_: RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/MainActivity.kt:337 — `catch (_: RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/util/GGUFParser.kt:154 — `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/util/UpscalerAssetPackSupport.kt:271 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/overlay/OverlayPermission.kt:75 — `catch (_: RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/navigation/AppLaunchIdentity.kt:41 — `catch (_: RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/navigation/AppLaunchIdentity.kt:50 — `catch (_: RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/navigation/AppLaunchIdentity.kt:56 — `catch (_: RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/navigation/AppLaunchIdentity.kt:65 — `catch (_: RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/navigation/AppLaunchIdentity.kt:72 — `catch (_: RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/navigation/AppLaunchIdentity.kt:91 — `catch (_: RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/models/ModelManagerViewModel.kt:157 — `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/models/ModelShareScreen.kt:490 — `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:1173 — `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/easy/EasyChatModelPicker.kt:108 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/easy/EasyChatModelPicker.kt:135 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/easy/EasyChatOptionsSheet.kt:213 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/easy/EasyModelRemoval.kt:119 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3893 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3979 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:4811 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:640 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×22
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/service/MangaPaintedOcrSupport.kt:717 — app/src/main/java/com/example/llamadroid/service/MangaPaintedOcrSupport.kt:717-726 | app/src/main/java/com/example/llamadroid/service/MangaPaintedOcrSupport.kt:728-735 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/service/DistributedMasterLlamaService.kt:182 — app/src/main/java/com/example/llamadroid/service/DistributedMasterLlamaService.kt:182-189 | app/src/main/java/com/example/llamadroid/service/LlamaRuntimeStateProjection.kt:235-242 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1085 — app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1085-1095 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1180-1187 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/onnx/OnnxBackgroundRemovalSupport.kt:616 — app/src/main/java/com/example/llamadroid/onnx/OnnxBackgroundRemovalSupport.kt:616-625 | app/src/main/java/com/example/llamadroid/onnx/OnnxTtsSupport.kt:856-863 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/data/repository/EasyLlamaChatCoordinator.kt:261 — app/src/main/java/com/example/llamadroid/data/repository/EasyLlamaChatCoordinator.kt:261-270 | app/src/main/java/com/example/llamadroid/data/repository/EasyLlamaChatCoordinator.kt:277-284 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3389 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3389-3396 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2908-2916 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/TermuxFileManagerScreen.kt:1082 — app/src/main/java/com/example/llamadroid/ui/ai/TermuxFileManagerScreen.kt:1082-1089 | app/src/main/java/com/example/llamadroid/ui/ai/ollama/OllamaManagerScreen.kt:819-828 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessPresetFiles.kt:126 — app/src/main/java/com/example/llamadroid/harness/HarnessPresetFiles.kt:126-133 | app/src/main/java/com/example/llamadroid/harness/HarnessPresetFiles.kt:135-142 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:566 — app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:566-573 | app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:3069-3076 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessUsageProjections.kt:20 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessUsageProjections.kt:20-27 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessUsageProjections.kt:29-40 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:2725 — app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:2725-2736 | app/src/main/java/com/example/llamadroid/ui/models/ModelPromotionChoices.kt:134-141 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessExtensionsPanels.kt:88 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessExtensionsPanels.kt:88-104 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessExtensionsPanels.kt:109-116 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/data/repository/LlamaRepository.kt:205 — app/src/main/java/com/example/llamadroid/data/repository/LlamaRepository.kt:205-217 | app/src/main/java/com/example/llamadroid/data/repository/LlamaRepository.kt:219-226 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceScreen.kt:419 — app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceScreen.kt:419-427 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1687-1694 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3TfliteWeights.kt:262 — app/src/main/java/com/example/llamadroid/audio/music/StableAudio3TfliteWeights.kt:262-269 | app/src/main/java/com/example/llamadroid/audio/music/StableAudio3TfliteWeights.kt:285-293 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentDirectPlanProjection.kt:328 — app/src/main/java/com/example/llamadroid/service/AgentDirectPlanProjection.kt:328-337 | app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:671-678 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:4277 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:4277-4285 | app/src/main/java/com/example/llamadroid/service/SDConfig.kt:183-190 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/data/model/library/RoomModelDeletionJournal.kt:294 — app/src/main/java/com/example/llamadroid/data/model/library/RoomModelDeletionJournal.kt:294-301 | app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:3705-3714 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:378 — app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:378-385 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeEnvironment.kt:457-464 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/service/LiveTranslatorNativeRunner.kt:23 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorNativeRunner.kt:23-30 | app/src/main/java/com/example/llamadroid/ui/components/RemoteSummaryBackendEditor.kt:56-63 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2680 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2680-2688 | app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:1067-1074 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:417 — app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:417-424 | app/src/main/java/com/example/llamadroid/service/PDFSummaryService.kt:344-352 — 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.
X2 · Cancellation propagation · Suspend function with a blocking request · ×22
  • Suspend function with a blocking request: awaitPreview app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:299 — `awaitPreview` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: probeAgentEndpoint app/src/main/java/com/example/llamadroid/service/AgentService.kt:1339 — `probeAgentEndpoint` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: installFromHttps app/src/main/java/com/example/llamadroid/service/AgentSkillRepository.kt:140 — `installFromHttps` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: searchWeb app/src/main/java/com/example/llamadroid/service/DeepResearchSupport.kt:125 — `searchWeb` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: fetchReadableSource app/src/main/java/com/example/llamadroid/service/DeepResearchSupport.kt:241 — `fetchReadableSource` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: countChatInputTokens app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt:214 — `countChatInputTokens` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: discoverCapabilities app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt:879 — `discoverCapabilities` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: webSearch app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2023 — `webSearch` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: kiwixSearch app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2151 — `kiwixSearch` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: post app/src/main/java/com/example/llamadroid/service/vision/VisionDescriptionService.kt:182 — `post` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: postJson app/src/main/java/com/example/llamadroid/service/ephemeral/EphemeralLlamaServer.kt:168 — `postJson` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: probe app/src/main/java/com/example/llamadroid/service/compaction/NativeChatContextWindow.kt:43 — `probe` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: fetchTotalSlots app/src/main/java/com/example/llamadroid/service/chat/ChatAdmissionPlanner.kt:89 — `fetchTotalSlots` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: downloadHarnessFile app/src/main/java/com/example/llamadroid/harness/HarnessAttachmentViewer.kt:62 — `downloadHarnessFile` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: searchKiwix app/src/main/java/com/example/llamadroid/harness/HarnessBridgeOperations.kt:555 — `searchKiwix` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: readKiwixArticle app/src/main/java/com/example/llamadroid/harness/HarnessBridgeOperations.kt:596 — `readKiwixArticle` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: models app/src/main/java/com/example/llamadroid/harness/HarnessLocalModels.kt:177 — `models` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: proxy app/src/main/java/com/example/llamadroid/harness/HarnessLocalModels.kt:1077 — `proxy` suspends, but makes its request with `call.execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: awaitPreview app/src/main/java/com/example/llamadroid/harness/HarnessRemoteProjectRunner.kt:438 — `awaitPreview` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: fetch app/src/main/java/com/example/llamadroid/data/runtime/AgentRuntimeEndpointModelDiscovery.kt:22 — `fetch` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: downloadRootfs app/src/main/java/com/example/llamadroid/data/proot/ProotManager.kt:68 — `downloadRootfs` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: fetchCatalog app/src/main/java/com/example/llamadroid/data/model/KiwixCatalogClient.kt:45 — `fetchCatalog` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×21
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:348 — app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:348-368 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeEnvironment.kt:436-447 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/ui/models/BundleItemBuilder.kt:568 — app/src/main/java/com/example/llamadroid/ui/models/BundleItemBuilder.kt:568-579 | app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryScreen.kt:1946-1961 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:656 — app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:656-667 | app/src/main/java/com/example/llamadroid/service/VideoRecognitionWhisperTranscriber.kt:210-221 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:404 — app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:404-415 | app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:417-428 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessInstallationFiles.kt:186 — app/src/main/java/com/example/llamadroid/harness/HarnessInstallationFiles.kt:186-197 | app/src/main/java/com/example/llamadroid/harness/HarnessLegacyDeletion.kt:129-141 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:815 — app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:815-827 | app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:829-840 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3567 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3567-3579 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskRunner.kt:429-440 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/tama/data/FarmDroneData.kt:394 — app/src/main/java/com/example/llamadroid/tama/data/FarmDroneData.kt:394-405 | app/src/main/java/com/example/llamadroid/tama/data/FarmDroneData.kt:407-418 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/GenerationBatteryOptimization.kt:100 — app/src/main/java/com/example/llamadroid/ui/ai/GenerationBatteryOptimization.kt:100-121 | app/src/main/java/com/example/llamadroid/ui/components/ModelStorageOverview.kt:24-35 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:3902 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:3902-3913 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:3942-3958 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/service/PDFService.kt:5659 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:5659-5672 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:5727-5738 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessAppWebSearch.kt:98 — app/src/main/java/com/example/llamadroid/harness/HarnessAppWebSearch.kt:98-109 | app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferClient.kt:160-174 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/service/CustomToolHttpExecutor.kt:209 — app/src/main/java/com/example/llamadroid/service/CustomToolHttpExecutor.kt:209-221 | app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:675-686 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/service/DatasetForegroundService.kt:175 — app/src/main/java/com/example/llamadroid/service/DatasetForegroundService.kt:175-186 | app/src/main/java/com/example/llamadroid/service/GenerationDiagnosticsStore.kt:652-664 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:999 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:999-1010 | app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:1112-1124 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/tama/notifications/TamaNotificationScheduler.kt:361 — app/src/main/java/com/example/llamadroid/tama/notifications/TamaNotificationScheduler.kt:361-372 | app/src/main/java/com/example/llamadroid/tama/notifications/TamaNotificationScheduler.kt:374-385 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferSessionCodec.kt:837 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferSessionCodec.kt:837-848 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferSessionCodec.kt:870-881 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:109 — app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:109-120 | app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:217-228 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:2868 — app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:2868-2879 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageMedia.kt:321-332 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:1041 — app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:1041-1052 | app/src/main/java/com/example/llamadroid/ui/ai/VideoUpscalerScreen.kt:586-597 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2002 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2002-2013 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1414-1425 — 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) · ×19
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessTransferMetadata.kt:659 — app/src/main/java/com/example/llamadroid/harness/HarnessTransferMetadata.kt:659-673 | app/src/main/java/com/example/llamadroid/harness/HarnessTransferMetadata.kt:680-696 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/ui/components/SampledImageBitmap.kt:25 — app/src/main/java/com/example/llamadroid/ui/components/SampledImageBitmap.kt:25-39 | app/src/main/java/com/example/llamadroid/ui/components/SampledImageBitmap.kt:44-58 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:351 — app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:351-365 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:469-485 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/AgentPreviewDownloadSupport.kt:499 — app/src/main/java/com/example/llamadroid/ui/agent/AgentPreviewDownloadSupport.kt:499-513 | app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:87-101 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMath.kt:70 — app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMath.kt:70-84 | app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMath.kt:93-107 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/data/runtime/AgentRuntimeProfileSupport.kt:117 — app/src/main/java/com/example/llamadroid/data/runtime/AgentRuntimeProfileSupport.kt:117-133 | app/src/main/java/com/example/llamadroid/data/runtime/AgentRuntimeProfileSupport.kt:174-188 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1988 — app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1988-2002 | app/src/main/java/com/example/llamadroid/sd/SdArtifactInspector.kt:1208-1226 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:194 — app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:194-209 | app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:228-242 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageMedia.kt:632 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageMedia.kt:632-660 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2816-2830 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/service/DistributedLlamaArguments.kt:9 — app/src/main/java/com/example/llamadroid/service/DistributedLlamaArguments.kt:9-23 | app/src/main/java/com/example/llamadroid/service/DistributedLlamaArguments.kt:25-42 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/ui/servers/ServersHubScreen.kt:142 — app/src/main/java/com/example/llamadroid/ui/servers/ServersHubScreen.kt:142-161 | app/src/main/java/com/example/llamadroid/ui/servers/ServersHubScreen.kt:164-178 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:1293 — app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:1293-1311 | app/src/main/java/com/example/llamadroid/tama/ui/TamaPetSprite.kt:32-46 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/data/backup/NativeChatNotesBackupManager.kt:960 — app/src/main/java/com/example/llamadroid/data/backup/NativeChatNotesBackupManager.kt:960-974 | app/src/main/java/com/example/llamadroid/data/model/ModelLibraryManager.kt:136-152 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2813 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2813-2827 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2829-2844 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2846 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2846-2860 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2862-2876 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:315 — app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:315-329 | app/src/main/java/com/example/llamadroid/service/chat/NativeChatVideoSupport.kt:720-737 — 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) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:737 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:737-751 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:753-767 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/AgentHistoryPaging.kt:87 — app/src/main/java/com/example/llamadroid/ui/agent/AgentHistoryPaging.kt:87-101 | app/src/main/java/com/example/llamadroid/ui/agent/AgentHistoryPaging.kt:103-117 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt:76 — app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt:76-90 | app/src/main/java/com/example/llamadroid/service/MediaTranslationForegroundService.kt:79-93 — 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 · Duplicated block (16 lines × 2) · ×19
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/service/DatasetBackendSupport.kt:120 — app/src/main/java/com/example/llamadroid/service/DatasetBackendSupport.kt:120-135 | app/src/main/java/com/example/llamadroid/service/DatasetBackendSupport.kt:213-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/DatasetBackendSupport.kt:120` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:901 — app/src/main/java/com/example/llamadroid/service/ProcessController.kt:901-916 | app/src/main/java/com/example/llamadroid/service/ProcessController.kt:1816-1831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/ProcessController.kt:901` 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 (16 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:323 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:323-338 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:420-435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:323` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:591 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:591-606 | app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1025-1040 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:591` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4588 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4588-4603 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4646-4661 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4588` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:578 — app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:578-593 | app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:1103-1118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:578` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:619 — app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:619-634 | app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:1166-1181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:619` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:191 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:191-206 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:444-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 `app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2464 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2464-2479 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:606-621 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2464` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4729 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4729-4744 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6852-6867 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4729` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5027 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5027-5042 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:2004-2019 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5027` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1193 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1193-1208 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1367-1382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1193` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5291 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5291-5306 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7214-7229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7231` calls `Spacer`, `height` and `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5307` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:318 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:318-333 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:334-349 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt` and `app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:318` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/components/DraftNumericTextFields.kt:65 — app/src/main/java/com/example/llamadroid/ui/components/DraftNumericTextFields.kt:65-80 | app/src/main/java/com/example/llamadroid/ui/components/DraftNumericTextFields.kt:122-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 `app/src/main/java/com/example/llamadroid/ui/components/DraftNumericTextFields.kt:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/components/RemoteSummaryBackendEditor.kt:491 — app/src/main/java/com/example/llamadroid/ui/components/RemoteSummaryBackendEditor.kt:491-506 | app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:2128-2143 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/components/RemoteSummaryBackendEditor.kt:491` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2046 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2046-2061 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2202-2217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2046` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkScreen.kt:284 — app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkScreen.kt:284-299 | app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkScreen.kt:309-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkScreen.kt:284` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:7171 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:7171-7186 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:7295-7310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:7171` 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.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×18
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:760 — app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:760-773 | app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:822-838 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/service/delegation/DelegationStatusFormatter.kt:23 — app/src/main/java/com/example/llamadroid/service/delegation/DelegationStatusFormatter.kt:23-36 | app/src/main/java/com/example/llamadroid/ui/ai/llama/delegation/DelegationViewerSupport.kt:109-127 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/FarmRepository.kt:587 — app/src/main/java/com/example/llamadroid/tama/game/FarmRepository.kt:587-601 | app/src/main/java/com/example/llamadroid/tama/game/FarmRepository.kt:606-619 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceScreen.kt:1357 — app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceScreen.kt:1357-1375 | app/src/main/java/com/example/llamadroid/ui/audio/library/AudioLibraryScreen.kt:964-977 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:2775 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:2775-2788 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:2796-2809 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:761 — app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:761-776 | app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:781-794 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:19096 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:19096-19109 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:19114-19128 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/service/DownloadService.kt:196 — app/src/main/java/com/example/llamadroid/service/DownloadService.kt:196-212 | app/src/main/java/com/example/llamadroid/service/DownloadService.kt:230-243 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:466 — app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:466-479 | app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:493-507 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/widget/TamaFarmWidget.kt:96 — app/src/main/java/com/example/llamadroid/widget/TamaFarmWidget.kt:96-109 | app/src/main/java/com/example/llamadroid/widget/TamaPetWidget.kt:82-95 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:188 — app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:188-201 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeEnvironment.kt:272-285 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:400 — app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:400-415 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:6462-6475 — 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) wear/src/main/java/com/example/llamadroid/wear/AdtTileActionActivities.kt:69 — wear/src/main/java/com/example/llamadroid/wear/AdtTileActionActivities.kt:69-82 | wear/src/main/java/com/example/llamadroid/wear/AdtTileActionActivities.kt:86-99 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/ui/navigation/AppLaunchIdentity.kt:46 — app/src/main/java/com/example/llamadroid/ui/navigation/AppLaunchIdentity.kt:46-59 | app/src/main/java/com/example/llamadroid/ui/navigation/AppLaunchIdentity.kt:61-75 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentSleepWakeScheduler.kt:125 — app/src/main/java/com/example/llamadroid/service/AgentSleepWakeScheduler.kt:125-139 | app/src/main/java/com/example/llamadroid/service/delegation/DelegationAlarmScheduler.kt:109-122 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:791 — app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:791-804 | app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:807-820 — 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) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:769 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:769-782 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:798-811 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentForegroundService.kt:821 — app/src/main/java/com/example/llamadroid/service/AgentForegroundService.kt:821-840 | app/src/main/java/com/example/llamadroid/service/DatasetForegroundService.kt:704-717 — 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×17
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:839 — app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:839-849 | app/src/main/java/com/example/llamadroid/ui/models/ModelClassificationOverrideUi.kt:156-169 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:481 — app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:481-507 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2971-2981 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:4409 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:4409-4419 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:4638-4649 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:294 — app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:294-305 | app/src/main/java/com/example/llamadroid/service/PDFTranslationLogic.kt:476-486 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1565 — app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1565-1575 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:1930-1940 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatDelegationSettingsSection.kt:500 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatDelegationSettingsSection.kt:500-510 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatDelegationSettingsSection.kt:513-525 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessPresetFiles.kt:170 — app/src/main/java/com/example/llamadroid/harness/HarnessPresetFiles.kt:170-180 | app/src/main/java/com/example/llamadroid/harness/HarnessRootfsFileStore.kt:714-724 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeProcess.kt:885 — app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeProcess.kt:885-895 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:491-502 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:1254 — app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:1254-1266 | app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:1268-1278 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4077 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4077-4087 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4090-4100 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:928 — app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:928-938 | app/src/main/java/com/example/llamadroid/service/AndroidTombstoneSummary.kt:142-153 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/service/bubble/ChatBubbleOverlayService.kt:162 — app/src/main/java/com/example/llamadroid/service/bubble/ChatBubbleOverlayService.kt:162-173 | app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiOverlayService.kt:196-206 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/service/bubble/ChatBubbleOverlayService.kt:329 — app/src/main/java/com/example/llamadroid/service/bubble/ChatBubbleOverlayService.kt:329-341 | app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiOverlayService.kt:741-751 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt:98 — app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt:98-108 | app/src/main/java/com/example/llamadroid/service/MediaTranslationForegroundService.kt:100-110 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3652 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3652-3662 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureScreen.kt:524-539 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:1549 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:1549-1559 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1854-1864 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/com/example/llamadroid/service/OnnxImageGenerationService.kt:639 — app/src/main/java/com/example/llamadroid/service/OnnxImageGenerationService.kt:639-649 | app/src/main/java/com/example/llamadroid/service/OnnxTtsGenerationService.kt:309-320 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×17
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/onnx/OnnxTtsSupport.kt:587 — app/src/main/java/com/example/llamadroid/onnx/OnnxTtsSupport.kt:587-593 | app/src/main/java/com/example/llamadroid/ui/ai/LiveTranslatorScreen.kt:120-126 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2722 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2722-2730 | app/src/main/java/com/example/llamadroid/ui/library/AllMediaGalleryScreen.kt:656-662 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessInstallationManager.kt:159 — app/src/main/java/com/example/llamadroid/harness/HarnessInstallationManager.kt:159-165 | app/src/main/java/com/example/llamadroid/harness/HarnessInstallationManager.kt:167-173 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3Models.kt:31 — app/src/main/java/com/example/llamadroid/audio/music/StableAudio3Models.kt:31-39 | app/src/main/java/com/example/llamadroid/audio/music/StableAudio3Models.kt:65-71 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskSchedule.kt:50 — app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskSchedule.kt:50-56 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskSchedule.kt:71-82 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:229 — app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:229-235 | app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:3197-3203 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:418 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:418-427 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferSessionCodec.kt:637-643 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessGoals.kt:169 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessGoals.kt:169-175 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessPluginActions.kt:345-352 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:187 — app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:187-195 | app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:217-223 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:712 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:712-718 | app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmDroneDialogs.kt:446-452 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaMapView.kt:272 — app/src/main/java/com/example/llamadroid/tama/ui/TamaMapView.kt:272-278 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2118-2124 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/data/db/NativeChatDelegationMigration.kt:173 — app/src/main/java/com/example/llamadroid/data/db/NativeChatDelegationMigration.kt:173-179 | app/src/main/java/com/example/llamadroid/data/db/NativeChatServerBindingMigration.kt:24-30 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/data/model/StableAudioModelSupport.kt:49 — app/src/main/java/com/example/llamadroid/data/model/StableAudioModelSupport.kt:49-58 | app/src/main/java/com/example/llamadroid/data/model/library/ModelLibraryRoleSupport.kt:11-17 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:478 — app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:478-484 | app/src/main/java/com/example/llamadroid/service/MangaPaintedOcrSupport.kt:763-769 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/data/easy/EasyGgufFlags.kt:69 — app/src/main/java/com/example/llamadroid/data/easy/EasyGgufFlags.kt:69-75 | app/src/main/java/com/example/llamadroid/service/ram/GgufModelShapeReader.kt:121-127 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessRootfsFileStore.kt:655 — app/src/main/java/com/example/llamadroid/harness/HarnessRootfsFileStore.kt:655-661 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:1278-1284 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/com/example/llamadroid/wear/PhoneWearGatewayService.kt:23 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGatewayService.kt:23-29 | app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeService.kt:23-29 — 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×17
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/util/NsdHelper.kt:180 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/util/NsdHelper.kt:189 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/util/NsdHelper.kt:209 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/pdf/PDFSummaryScreen.kt:153 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:185 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:201 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:216 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:1379 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3935 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:4005 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:4853 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:4895 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:4918 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:4930 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:4965 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:5014 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:5071 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×16
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:839 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:839-856 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1353-1375 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessReferenceCatalogs.kt:20 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessReferenceCatalogs.kt:20-37 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessReferenceCatalogs.kt:39-56 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferSessionCodec.kt:331 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferSessionCodec.kt:331-349 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferSessionCodec.kt:362-379 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:3622 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:3622-3639 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3543-3562 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1217 — app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1217-1235 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1241-1258 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1254 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1254-1271 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1079-1096 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:341 — app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:341-358 | app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:363-383 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:865 — app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:865-883 | app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:901-918 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/service/LiveTranslatorLiteRtEngineManager.kt:46 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorLiteRtEngineManager.kt:46-63 | app/src/main/java/com/example/llamadroid/service/LiveTranslatorLiteRtEngineManager.kt:71-91 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/ui/components/VideoAdditionalOptionsEditor.kt:328 — app/src/main/java/com/example/llamadroid/ui/components/VideoAdditionalOptionsEditor.kt:328-349 | app/src/main/java/com/example/llamadroid/ui/components/VideoRuntimeOptionsEditor.kt:1058-1075 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1000 — app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1000-1020 | app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1046-1063 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1032 — app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1032-1049 | app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1063-1080 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2689 — app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2689-2706 | app/src/main/java/com/example/llamadroid/widget/NoteDisplayWidget.kt:516-533 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/service/VideoRecognitionSummaryService.kt:1268 — app/src/main/java/com/example/llamadroid/service/VideoRecognitionSummaryService.kt:1268-1285 | app/src/main/java/com/example/llamadroid/service/VideoRecognitionSummaryService.kt:1292-1312 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:2609 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:2609-2626 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:2637-2654 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/com/example/llamadroid/service/DatasetForegroundService.kt:312 — app/src/main/java/com/example/llamadroid/service/DatasetForegroundService.kt:312-329 | app/src/main/java/com/example/llamadroid/service/DatasetForegroundService.kt:331-349 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×16
  • Edited copy of a member (13 corresponding lines) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2827 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2827-2839 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2842-2858 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6798 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6798-6810 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4668-4683 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessFormatting.kt:61 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessFormatting.kt:61-73 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessFormatting.kt:75-88 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:509 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:509-521 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:325-337 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/SdIpAdapterControls.kt:395 — app/src/main/java/com/example/llamadroid/ui/ai/SdIpAdapterControls.kt:395-407 | app/src/main/java/com/example/llamadroid/widget/NoteDisplayWidget.kt:543-557 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:401 — app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:401-413 | app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:421-433 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:272 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:272-285 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:287-299 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/ollama/OllamaViewModel.kt:177 — app/src/main/java/com/example/llamadroid/ui/ai/ollama/OllamaViewModel.kt:177-189 | app/src/main/java/com/example/llamadroid/ui/ai/ollama/OllamaViewModel.kt:214-226 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessAppRuntime.kt:357 — app/src/main/java/com/example/llamadroid/harness/HarnessAppRuntime.kt:357-369 | app/src/main/java/com/example/llamadroid/harness/HarnessAppRuntime.kt:371-385 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessOriginalWebView.kt:162 — app/src/main/java/com/example/llamadroid/harness/HarnessOriginalWebView.kt:162-174 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeReadiness.kt:160-175 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/tama/data/TamaMarket.kt:56 — app/src/main/java/com/example/llamadroid/tama/data/TamaMarket.kt:56-68 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3905-3917 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:4261 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:4261-4275 | app/src/main/java/com/example/llamadroid/tama/game/TamaTransferBundle.kt:477-489 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/ServerRegistryViewModel.kt:168 — app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/ServerRegistryViewModel.kt:168-181 | app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/ServerRegistryViewModel.kt:184-196 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:2641 — app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:2641-2653 | app/src/main/java/com/example/llamadroid/service/DistributedService.kt:357-369 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:664 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:664-676 | app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:489-501 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) app/src/main/java/com/example/llamadroid/service/LiteRtGpuDiagnostics.kt:497 — app/src/main/java/com/example/llamadroid/service/LiteRtGpuDiagnostics.kt:497-510 | app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:614-626 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×16
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:2001 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:2001-2017 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:2133-2149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:2001` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:18861 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:18861-18877 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:18968-18984 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:18861` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt:50 — app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt:50-66 | app/src/main/java/com/example/llamadroid/service/MediaTranslationForegroundService.kt:53-69 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt` and `app/src/main/java/com/example/llamadroid/service/MediaTranslationForegroundService.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt:50` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4046 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4046-4062 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4308-4324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4046` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5753 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5753-5769 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5829-5845 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5753` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5771` calls `stringResource` and `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5847` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:284 — app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:284-300 | app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:380-396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:284` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:594 — app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:594-610 | app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:1120-1136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:1120` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:1119` calls `Spacer`, `height` and `app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:593` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/AiJobStartupGuard.kt:26 — app/src/main/java/com/example/llamadroid/ui/ai/AiJobStartupGuard.kt:26-42 | app/src/main/java/com/example/llamadroid/ui/ai/AiJobStartupGuard.kt:45-61 — both copies are in the same file, so extract the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `block` to `(` in one and `suspend (` 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 (17 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4556 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4556-4572 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5249-5265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4556` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:1319 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:1319-1335 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:1700-1716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:1319` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:478 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:478-494 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1185-1201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:478` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:706 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:706-722 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1213-1229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:706` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1320 — app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1320-1336 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1403-1419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:302 — app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:302-318 | app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:401-417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:302` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:727 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:727-743 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:475-491 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt` and `app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) app/src/main/java/com/example/llamadroid/service/chat/NativeChatVideoSupport.kt:294 — app/src/main/java/com/example/llamadroid/service/chat/NativeChatVideoSupport.kt:294-311 | app/src/main/java/com/example/llamadroid/service/chat/NativeChatVideoSupport.kt:362-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/chat/NativeChatVideoSupport.kt:294` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×14
  • Edited copy of a member (4 corresponding lines) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2080 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2080-2083 | app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2085-2091 — 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) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetails.kt:791 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetails.kt:791-795 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetails.kt:977-980 — 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) app/src/main/java/com/example/llamadroid/harness/HarnessRecoveryFileServer.kt:183 — app/src/main/java/com/example/llamadroid/harness/HarnessRecoveryFileServer.kt:183-186 | app/src/main/java/com/example/llamadroid/service/HarnessRecoveryTerminalSessionManager.kt:232-235 — 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) app/src/main/java/com/example/llamadroid/service/LlamaServerSessionOwnerStore.kt:40 — app/src/main/java/com/example/llamadroid/service/LlamaServerSessionOwnerStore.kt:40-43 | app/src/main/java/com/example/llamadroid/service/LlamaServerSessionStateStore.kt:28-32 — 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) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1262 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1262-1268 | app/src/main/java/com/example/llamadroid/service/delegation/DelegateServerResolver.kt:118-121 — 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) app/src/main/java/com/example/llamadroid/service/LlamaServerSessionOwnerStore.kt:27 — app/src/main/java/com/example/llamadroid/service/LlamaServerSessionOwnerStore.kt:27-30 | app/src/main/java/com/example/llamadroid/service/LlamaServerSessionStateStore.kt:15-20 — 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) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:1303 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:1303-1306 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:586-589 — 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) app/src/main/java/com/example/llamadroid/sd/SdArtifactInspection.kt:63 — app/src/main/java/com/example/llamadroid/sd/SdArtifactInspection.kt:63-66 | app/src/main/java/com/example/llamadroid/sd/SdBackendModes.kt:9-12 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) app/src/main/java/com/example/llamadroid/sd/SdArtifactInspection.kt:83 — app/src/main/java/com/example/llamadroid/sd/SdArtifactInspection.kt:83-86 | app/src/main/java/com/example/llamadroid/sd/SdBackendModes.kt:22-25 — 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) app/src/main/java/com/example/llamadroid/wear/TamaWearLocationUi.kt:115 — app/src/main/java/com/example/llamadroid/wear/TamaWearLocationUi.kt:115-118 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:3196-3199 — 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) app/src/main/java/com/example/llamadroid/data/db/RestoreCoordinator.kt:613 — app/src/main/java/com/example/llamadroid/data/db/RestoreCoordinator.kt:613-616 | app/src/main/java/com/example/llamadroid/util/DownloadResumeMetadata.kt:68-71 — 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) app/src/main/java/com/example/llamadroid/service/titlegen/TitleGenerationLogic.kt:57 — app/src/main/java/com/example/llamadroid/service/titlegen/TitleGenerationLogic.kt:57-60 | app/src/main/java/com/example/llamadroid/ui/ai/llama/delegation/DelegationViewerSupport.kt:83-86 — 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) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5055 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5055-5058 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:2038-2041 — 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) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:96 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:96-99 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskService.kt:472-475 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×14
  • Edited copy of a member (5 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessLanAccess.kt:535 — app/src/main/java/com/example/llamadroid/harness/HarnessLanAccess.kt:535-540 | app/src/main/java/com/example/llamadroid/harness/HarnessLanAccess.kt:542-546 — 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) app/src/main/java/com/example/llamadroid/ui/audio/music/MusicWorkspaceDraft.kt:42 — app/src/main/java/com/example/llamadroid/ui/audio/music/MusicWorkspaceDraft.kt:42-47 | app/src/main/java/com/example/llamadroid/ui/audio/music/MusicWorkspaceDraft.kt:49-53 — 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) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:1226 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:1226-1230 | app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:1243-1252 — 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) app/src/main/java/com/example/llamadroid/harness/HarnessBaseCacheRegistry.kt:232 — app/src/main/java/com/example/llamadroid/harness/HarnessBaseCacheRegistry.kt:232-237 | app/src/main/java/com/example/llamadroid/harness/HarnessLocalModels.kt:1101-1105 — 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) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3331 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3331-3335 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3338-3343 — 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) app/src/main/java/com/example/llamadroid/ui/audio/music/MusicWorkspaceController.kt:222 — app/src/main/java/com/example/llamadroid/ui/audio/music/MusicWorkspaceController.kt:222-227 | app/src/main/java/com/example/llamadroid/ui/audio/music/MusicWorkspaceController.kt:228-232 — 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) app/src/main/java/com/example/llamadroid/harness/HarnessAtomicFile.kt:76 — app/src/main/java/com/example/llamadroid/harness/HarnessAtomicFile.kt:76-80 | app/src/main/java/com/example/llamadroid/harness/HarnessSessionAtomicFile.kt:95-100 — 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) app/src/main/java/com/example/llamadroid/service/AiServerSupport.kt:223 — app/src/main/java/com/example/llamadroid/service/AiServerSupport.kt:223-228 | app/src/main/java/com/example/llamadroid/service/filestation/http/AuthGate.kt:147-151 — 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) app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:2667 — app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:2667-2672 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3930-3934 — 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) app/src/main/java/com/example/llamadroid/service/LlamaServerSessionOwnerStore.kt:34 — app/src/main/java/com/example/llamadroid/service/LlamaServerSessionOwnerStore.kt:34-38 | app/src/main/java/com/example/llamadroid/service/LlamaServerSessionStateStore.kt:22-26 — 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) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateJournal.kt:60 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateJournal.kt:60-64 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateStoryUi.kt:172-178 — 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) app/src/main/java/com/example/llamadroid/tama/data/TamaBedtimeRules.kt:22 — app/src/main/java/com/example/llamadroid/tama/data/TamaBedtimeRules.kt:22-26 | app/src/main/java/com/example/llamadroid/tama/data/TamaPet.kt:82-86 — 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) app/src/main/java/com/example/llamadroid/onnx/OnnxTtsSupport.kt:213 — app/src/main/java/com/example/llamadroid/onnx/OnnxTtsSupport.kt:213-219 | app/src/main/java/com/example/llamadroid/ui/audio/library/AudioLibraryScreen.kt:1108-1112 — 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) app/src/main/java/com/example/llamadroid/harness/HarnessRecoveryFileServer.kt:456 — app/src/main/java/com/example/llamadroid/harness/HarnessRecoveryFileServer.kt:456-460 | app/src/main/java/com/example/llamadroid/service/AiServerSupport.kt:184-188 — 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.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×13
  • Edited copy of a member (16 corresponding lines) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1475 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1475-1490 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1492-1514 — 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) app/src/main/java/com/example/llamadroid/service/filestation/volume/SafVolume.kt:216 — app/src/main/java/com/example/llamadroid/service/filestation/volume/SafVolume.kt:216-235 | app/src/main/java/com/example/llamadroid/service/filestation/volume/SafVolume.kt:237-252 — 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) app/src/main/java/com/example/llamadroid/service/AgentWebSearchSupport.kt:190 — app/src/main/java/com/example/llamadroid/service/AgentWebSearchSupport.kt:190-205 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3908-3925 — 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) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt:256 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt:256-271 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:556-572 — 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) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3616 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3616-3631 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3634-3649 — 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) app/src/main/java/com/example/llamadroid/service/DistributedService.kt:1106 — app/src/main/java/com/example/llamadroid/service/DistributedService.kt:1106-1126 | app/src/main/java/com/example/llamadroid/service/SdDistributedService.kt:170-185 — 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) app/src/main/java/com/example/llamadroid/ui/agent/AgentProotDialogs.kt:130 — app/src/main/java/com/example/llamadroid/ui/agent/AgentProotDialogs.kt:130-145 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatOptionsDialog.kt:201-222 — 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) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:463 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:463-478 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:612-628 — 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) app/src/main/java/com/example/llamadroid/ui/settings/LlmSettingsHelpers.kt:171 — app/src/main/java/com/example/llamadroid/ui/settings/LlmSettingsHelpers.kt:171-186 | app/src/main/java/com/example/llamadroid/ui/settings/LlmSettingsHelpers.kt:197-216 — 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) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1274 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1274-1289 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatScreenSupport.kt:162-178 — 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) app/src/main/java/com/example/llamadroid/harness/HarnessRemoteProjectRunner.kt:438 — app/src/main/java/com/example/llamadroid/harness/HarnessRemoteProjectRunner.kt:438-453 | app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:299-318 — 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) app/src/main/java/com/example/llamadroid/service/LlamaCliSupport.kt:51 — app/src/main/java/com/example/llamadroid/service/LlamaCliSupport.kt:51-66 | app/src/main/java/com/example/llamadroid/service/WhisperCliSupport.kt:54-72 — 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) app/src/main/java/com/example/llamadroid/data/model/AudioCuratedBundleCatalog.kt:22 — app/src/main/java/com/example/llamadroid/data/model/AudioCuratedBundleCatalog.kt:22-37 | app/src/main/java/com/example/llamadroid/data/model/AudioCuratedBundleCatalog.kt:48-63 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×13
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:599 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:599-616 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:352-369 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt` and `app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1216 — app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1216-1233 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1288-1305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1216` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/service/DeepResearchService.kt:457 — app/src/main/java/com/example/llamadroid/service/DeepResearchService.kt:457-474 | app/src/main/java/com/example/llamadroid/service/KnowledgeBaseIndexingService.kt:240-257 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/DeepResearchService.kt:457` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1820 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1820-1837 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1844-1861 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1820` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2259 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:2259-2276 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:2277-2294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:1030 — app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:1030-1047 | app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:1167-1184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:1167` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:389 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:389-406 | app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:504-521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:389` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3728 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3728-3745 | app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:1221-1238 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3728` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:293 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:293-310 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:519-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:293` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1432 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1432-1449 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1721-1738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1432` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:290 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:290-307 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:583-600 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:290` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:542 — app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:542-559 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:605-622 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) app/src/main/java/com/example/llamadroid/ui/settings/WelcomeScreen.kt:276 — app/src/main/java/com/example/llamadroid/ui/settings/WelcomeScreen.kt:276-293 | app/src/main/java/com/example/llamadroid/ui/settings/WelcomeScreen.kt:349-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/WelcomeScreen.kt:276` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×12
  • Edited copy of a member (19 corresponding lines) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMerge.kt:559 — app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMerge.kt:559-577 | app/src/main/java/com/example/llamadroid/audio/music/StableAudio3SafeTensors.kt:246-264 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:293 — app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:293-311 | app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:314-332 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:724 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:724-745 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:751-769 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:285 — app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:285-303 | app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryViewModel.kt:321-339 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) wear/src/main/java/com/example/llamadroid/wear/AdtTileActionActivities.kt:123 — wear/src/main/java/com/example/llamadroid/wear/AdtTileActionActivities.kt:123-142 | wear/src/main/java/com/example/llamadroid/wear/AdtTileActionActivities.kt:186-204 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:976 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:976-995 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferSessionCodec.kt:1021-1039 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaService.kt:99 — app/src/main/java/com/example/llamadroid/service/LlamaService.kt:99-121 | app/src/main/java/com/example/llamadroid/service/LlamaService.kt:123-141 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2700 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2700-2718 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2791-2811 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:1999 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:1999-2017 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:2130-2149 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/AdventureSettingsDialog.kt:461 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureSettingsDialog.kt:461-479 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3111-3132 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1956 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1956-1977 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1394-1412 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) app/src/main/java/com/example/llamadroid/data/backup/NativeChatNotesBackupManager.kt:825 — app/src/main/java/com/example/llamadroid/data/backup/NativeChatNotesBackupManager.kt:825-844 | app/src/main/java/com/example/llamadroid/data/backup/NativeChatNotesBackupManager.kt:847-865 — 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×12
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/data/model/LocalModelImports.kt:153 — app/src/main/java/com/example/llamadroid/data/model/LocalModelImports.kt:153-165 | app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1938-1950 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1114-1126 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:826-838 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1526 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1526-1569 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1689-1698 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1898-1937 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1951-1991 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:97 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:97-636 | app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:69-1038 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:98-1493 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatScreenSupport.kt:98-118 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/agent/AgentNewProjectDialog.kt:33 — app/src/main/java/com/example/llamadroid/ui/agent/AgentNewProjectDialog.kt:33-137 | app/src/main/java/com/example/llamadroid/ui/agent/AgentPlanEditorDialog.kt:39-84 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:1571-1602 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:1842-1915 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/agent/AgentSkillManager.kt:72 — app/src/main/java/com/example/llamadroid/ui/agent/AgentSkillManager.kt:72-413 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:721-2272 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:122-612 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:226-953 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:69 — app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:69-1038 | app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:72-971 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5287-5334 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6952-7527 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:144 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:144-4518 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:185-697 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:195-1564 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5903-6770 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4087 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4087-4521 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4797-5219 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5903-6770 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6952-7527 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5287 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5287-5334 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5556-5608 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5903-6770 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6952-7527 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1125 — app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1125-1156 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:2288-2324 | app/src/main/java/com/example/llamadroid/ui/settings/ChatKvCacheStorageCard.kt:32-160 | app/src/main/java/com/example/llamadroid/ui/settings/SpeculativeRunHistoryCard.kt:48-123 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:538 — app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:538-664 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:671-738 | app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:346-441 | app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:450-508 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:57 — app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:57-273 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:104-1992 | app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:48-175 | app/src/main/java/com/example/llamadroid/ui/settings/WhisperSettingsScreen.kt:60-381 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×12
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/service/MangaPaintedOcrSupport.kt:756 — app/src/main/java/com/example/llamadroid/service/MangaPaintedOcrSupport.kt:756-761 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:6761-6774 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/service/OnnxTtsGenerationService.kt:355 — app/src/main/java/com/example/llamadroid/service/OnnxTtsGenerationService.kt:355-360 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:748-753 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:405 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:405-415 | app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:1950-1955 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessTransferPublication.kt:268 — app/src/main/java/com/example/llamadroid/harness/HarnessTransferPublication.kt:268-273 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:602-611 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeProcess.kt:768 — app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeProcess.kt:768-774 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeProcess.kt:777-782 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/service/filestation/api/FsWriteApi.kt:196 — app/src/main/java/com/example/llamadroid/service/filestation/api/FsWriteApi.kt:196-201 | app/src/main/java/com/example/llamadroid/service/filestation/api/FsWriteApi.kt:203-210 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:5306 — app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:5306-5313 | app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryDialogs.kt:195-200 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessInstallationManager.kt:99 — app/src/main/java/com/example/llamadroid/harness/HarnessInstallationManager.kt:99-106 | app/src/main/java/com/example/llamadroid/harness/HarnessInstallationManager.kt: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.
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:442 — app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:442-447 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2668-2678 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/onnx/OnnxModelSupport.kt:63 — app/src/main/java/com/example/llamadroid/onnx/OnnxModelSupport.kt:63-69 | app/src/main/java/com/example/llamadroid/service/SdCaching.kt:12-17 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentPromptMessageOrdering.kt:82 — app/src/main/java/com/example/llamadroid/service/AgentPromptMessageOrdering.kt:82-87 | app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:81-86 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1267 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1267-1272 | app/src/main/java/com/example/llamadroid/util/FormatUtils.kt:44-49 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×10
  • Edited copy of a member (17 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:1086 — app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:1086-1102 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:844-864 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/com/example/llamadroid/service/PDFService.kt:5782 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:5782-5807 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:7560-7576 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeTransfer.kt:929 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeTransfer.kt:929-950 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeTransfer.kt:957-973 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/ClassicFarmPlots.kt:37 — app/src/main/java/com/example/llamadroid/tama/game/ClassicFarmPlots.kt:37-55 | app/src/main/java/com/example/llamadroid/tama/game/FarmSmartActions.kt:189-205 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMerge.kt:356 — app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMerge.kt:356-373 | app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMerge.kt:380-396 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:4097 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:4097-4114 | app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:1050-1066 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceRuntimeController.kt:370 — app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceRuntimeController.kt:370-386 | app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceRuntimeController.kt:388-404 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1622 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1622-1638 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4075-4098 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaSoftStudioComponents.kt:39 — app/src/main/java/com/example/llamadroid/tama/ui/TamaSoftStudioComponents.kt:39-55 | app/src/main/java/com/example/llamadroid/ui/components/AppChrome.kt:257-273 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:49 — app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:49-69 | app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:82-98 — 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 · Duplicated block (19 lines × 2) · ×10
  • Duplicated block (19 lines × 2) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:441 — app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:441-459 | app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:597-615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:441` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:594` calls `updateProgress` and `app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:436` 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 (19 lines × 2) app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:992 — app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:992-1010 | app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:1144-1162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:992` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:991` calls `log` and `app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:1143` 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 (19 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:622 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:622-640 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:375-393 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt` and `app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:757 — app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:757-775 | app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:1404-1422 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:757` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1139 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1139-1157 | app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1184-1202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1139` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:310 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:310-328 | app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:419-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:310` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:524 — app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:524-542 | app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:653-671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:524` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (19 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/CustomToolsScreen.kt:236 — app/src/main/java/com/example/llamadroid/ui/agent/CustomToolsScreen.kt:236-254 | app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:42-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/CustomToolsScreen.kt:236` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2926 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2926-2944 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:3224-3242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2926` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1718 — app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1718-1736 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1791-1809 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1718` 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×10
  • Duplicated block (13–14 lines × 2) app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:154 — app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:154-167 | app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:562-574 — both copies are in the same file, so extract the 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–14 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:813 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:813-825 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:6554-6567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:813` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2838 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:2838-2851 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:2994-3006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:2838` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13–14 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3768 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3768-3781 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2032-2044 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3768` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2031` calls `stringResource` and `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3767` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13–14 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:426 — app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:426-438 | app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1115-1128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:426` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13–14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/QuadtrixWebUiScreen.kt:135 — app/src/main/java/com/example/llamadroid/ui/ai/QuadtrixWebUiScreen.kt:135-147 | app/src/main/java/com/example/llamadroid/ui/chat/ChatScreen.kt:217-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/QuadtrixWebUiScreen.kt:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2141 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2141-2154 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1669-1681 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:179 — app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:179-191 | app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:194-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13–14 lines × 2) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1342 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1342-1355 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1462-1474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1342` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:72 — app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:72-85 | app/src/main/java/com/example/llamadroid/ui/settings/WhisperSettingsScreen.kt:85-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:72` 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×10
  • Duplicated block (6 lines × 3) app/src/main/java/com/example/llamadroid/harness/HarnessProjectIntegrationDialog.kt:130 — app/src/main/java/com/example/llamadroid/harness/HarnessProjectIntegrationDialog.kt:130-135 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:539-544 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:907-912 — 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 (6 lines × 3) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:822 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:822-827 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:913-918 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:993-998 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:822` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) app/src/main/java/com/example/llamadroid/service/DistributedService.kt:1624 — app/src/main/java/com/example/llamadroid/service/DistributedService.kt:1624-1629 | app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:177-184 | app/src/main/java/com/example/llamadroid/service/ZimShareService.kt:157-163 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/service/ModelShareService.kt` and `app/src/main/java/com/example/llamadroid/service/ZimShareService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/DistributedService.kt:1624` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 3) app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:343 — app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:343-348 | app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:404-409 | app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:442-447 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:411` calls `AdventureGatePurchaseResult` and `app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:349` 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 × 3) app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:620 — app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:620-628 | app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:573-580 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7231-7236 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt: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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:570` calls `TextButton`, `navigate`, `Text` and `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7228` 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 × 3) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3900 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3900-3905 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2733-2738 | app/src/main/java/com/example/llamadroid/ui/library/AllMediaGalleryScreen.kt:690-695 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3900` it does not close everything it opens, so those 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 `item` to `WorkflowOutputGalleryFile` in one and `SdGeneratedMediaItem` 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 (6 lines × 3) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2148 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2148-2153 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2172-2177 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2200-2205 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 3) app/src/main/java/com/example/llamadroid/data/db/ModelEntity.kt:66 — app/src/main/java/com/example/llamadroid/data/db/ModelEntity.kt:66-71 | app/src/main/java/com/example/llamadroid/data/db/ModelEntity.kt:86-91 | app/src/main/java/com/example/llamadroid/sd/SdModelSupport.kt:169-174 — 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 (6 lines × 3) app/src/main/java/com/example/llamadroid/audio/AudioGenerationService.kt:587 — app/src/main/java/com/example/llamadroid/audio/AudioGenerationService.kt:587-592 | app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt:110-115 | app/src/main/java/com/example/llamadroid/service/MediaTranslationForegroundService.kt:112-117 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt` and `app/src/main/java/com/example/llamadroid/service/MediaTranslationForegroundService.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (6 lines × 3) app/src/main/java/com/example/llamadroid/harness/HarnessLanAccess.kt:186 — app/src/main/java/com/example/llamadroid/harness/HarnessLanAccess.kt:186-191 | app/src/main/java/com/example/llamadroid/harness/HarnessRecoveryFileServer.kt:159-164 | app/src/main/java/com/example/llamadroid/service/HarnessRecoveryTerminalSessionManager.kt:124-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×9
  • Duplicated block (10 lines × 3) app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:364 — app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:364-373 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:4136-4145 | app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:1087-1096 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:364` 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 × 3) app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1083 — app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1083-1092 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1111-1120 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1137-1146 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1083` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:108 — app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:108-117 | app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:125-134 | app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:200-209 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmUpgradeDialogs.kt:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:671 — app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:671-680 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1362-1371 | app/src/main/java/com/example/llamadroid/ui/ai/VideoUpscalerScreen.kt:485-494 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:671` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2257 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2257-2267 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:435-444 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:939-949 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2257` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:608 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:608-617 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:707-716 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1214-1223 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:608` 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 × 3) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3855 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3855-3864 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3934-3943 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4004-4013 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3855` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3944` calls `AdventureGateStatChip`, `stringResource`, `toString` and `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3865` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:876 — app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:876-887 | app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:929-938 | app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:964-973 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:876` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:608 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:608-617 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:290-299 | app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:498-507 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:608` 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.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×8
  • Duplicated block (20 lines × 2) app/src/main/java/com/example/llamadroid/service/DownloadService.kt:1839 — app/src/main/java/com/example/llamadroid/service/DownloadService.kt:1839-1858 | app/src/main/java/com/example/llamadroid/service/DownloadService.kt:2043-2062 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/DownloadService.kt:1839` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (20 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFSummaryService.kt:84 — app/src/main/java/com/example/llamadroid/service/PDFSummaryService.kt:84-103 | app/src/main/java/com/example/llamadroid/service/VideoSumupService.kt:84-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:875 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:875-894 | app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1225-1244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1225` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1223` calls `onPreview` and `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:874` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (20 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:656 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:656-675 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5662-5681 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:656` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:770 — app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:770-789 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1500-1519 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:770` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1411 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1411-1430 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1700-1719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1411` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) app/src/main/java/com/example/llamadroid/ui/audio/library/AudioLibraryScreen.kt:839 — app/src/main/java/com/example/llamadroid/ui/audio/library/AudioLibraryScreen.kt:839-858 | app/src/main/java/com/example/llamadroid/ui/audio/library/AudioLibraryScreen.kt:915-934 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/audio/library/AudioLibraryScreen.kt:839` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:7059 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:7059-7078 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:7135-7154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:7059` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×8
  • Duplicated block (17–18 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:8792 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:8792-8809 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:8903-8919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:8792` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:9367 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:9367-9383 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:9444-9461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:9367` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:18241 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:18241-18257 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:18283-18300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:18241` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:1194 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:1194-1210 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:1253-1270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:1194` it begins part-way through the construct above it, so those 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 (17–18 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:229 — app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:229-245 | app/src/main/java/com/example/llamadroid/ui/ai/MangaPaintedMaskEditor.kt:356-373 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17–18 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2118 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2118-2135 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1646-1662 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1645` calls `isEmpty` and `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2117` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17–18 lines × 2) app/src/main/java/com/example/llamadroid/ui/walkthrough/FeatureMediaModelGuides.kt:433 — app/src/main/java/com/example/llamadroid/ui/walkthrough/FeatureMediaModelGuides.kt:433-449 | app/src/main/java/com/example/llamadroid/ui/walkthrough/FeatureOtherGuides.kt:631-648 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/walkthrough/FeatureMediaModelGuides.kt:433` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (17–18 lines × 2) app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:359 — app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:359-376 | app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:423-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt: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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×8
  • Duplicated block (11 lines × 3) app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:105 — app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:105-115 | app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:195-205 | app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:328-338 — 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. The matched lines also transfer control out of the body holding them, which cannot 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) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:596 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:596-606 | app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1030-1040 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageMedia.kt:589-599 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:596` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:777 — app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:777-787 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:777-787 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1507-1517 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:777` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:749 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:749-759 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:761-771 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6012-6022 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:749` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:1684 — app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:1684-1694 | app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:1924-1934 | app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:1443-1453 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:1684` 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 (11 lines × 3) app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:58 — app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:58-68 | app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:89-99 | app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:120-130 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:89 — app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:89-99 | app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:120-130 | app/src/main/java/com/example/llamadroid/ui/settings/WhisperSettingsScreen.kt:131-141 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/settings/WhisperSettingsScreen.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:1218 — app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:1218-1228 | app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:1261-1271 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1078-1088 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:1261` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1090` calls `Text`, `stringResource`, `Spacer` and `app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:1229` 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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×8
  • Duplicated block (7 lines × 3) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:786 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:786-792 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:866-872 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:1650-1656 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:143 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:143-153 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:267-273 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:429-439 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRootfsFileBrowser.kt:327 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRootfsFileBrowser.kt:327-333 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRootfsFileBrowser.kt:399-405 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRootfsFileBrowser.kt:435-441 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRootfsFileBrowser.kt:327` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskScheduler.kt:41 — app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskScheduler.kt:41-47 | app/src/main/java/com/example/llamadroid/service/OrganizerAlarmScheduler.kt:123-129 | app/src/main/java/com/example/llamadroid/tama/notifications/TamaNotificationScheduler.kt:291-297 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskScheduler.kt:48` calls `log` and `app/src/main/java/com/example/llamadroid/service/OrganizerAlarmScheduler.kt:130` 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 × 3) app/src/main/java/com/example/llamadroid/data/db/ModelEntity.kt:73 — app/src/main/java/com/example/llamadroid/data/db/ModelEntity.kt:73-79 | app/src/main/java/com/example/llamadroid/data/db/ModelEntity.kt:93-99 | app/src/main/java/com/example/llamadroid/sd/SdModelSupport.kt:176-182 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 3) app/src/main/java/com/example/llamadroid/sd/SdModelSupport.kt:36 — app/src/main/java/com/example/llamadroid/sd/SdModelSupport.kt:36-42 | app/src/main/java/com/example/llamadroid/sd/SdVideoRuntime.kt:21-27 | app/src/main/java/com/example/llamadroid/sd/SdVideoRuntime.kt:44-50 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatViewModel.kt:248 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatViewModel.kt:248-254 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaServerViewModel.kt:286-292 | app/src/main/java/com/example/llamadroid/ui/ai/ollama/OllamaViewModel.kt:230-236 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (7 lines × 3) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:465 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:465-471 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:562-568 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:204-210 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:465` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×7
  • Edited copy of a member (26 corresponding lines) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2956 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2956-2985 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2993-3018 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:466 — app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:466-491 | app/src/main/java/com/example/llamadroid/ui/ai/InpaintWorkspaceManager.kt:116-156 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) app/src/main/java/com/example/llamadroid/service/bubble/ChatBubbleOverlayService.kt:282 — app/src/main/java/com/example/llamadroid/service/bubble/ChatBubbleOverlayService.kt:282-318 | app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiOverlayService.kt:291-316 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetailsPanel.kt:121 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetailsPanel.kt:121-155 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetailsPanel.kt:161-186 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:621 — app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:621-650 | app/src/main/java/com/example/llamadroid/service/VideoRecognitionWhisperTranscriber.kt:179-204 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1269 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1269-1294 | app/src/main/java/com/example/llamadroid/tama/game/TamaTransferBundle.kt:925-951 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) app/src/main/java/com/example/llamadroid/data/db/AppDatabase.kt:263 — app/src/main/java/com/example/llamadroid/data/db/AppDatabase.kt:263-289 | app/src/main/java/com/example/llamadroid/tama/db/TamaDatabase.kt:58-83 — 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 (22 corresponding lines) · ×7
  • Edited copy of a member (22 corresponding lines) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:435 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:435-460 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:527-548 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2269 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2269-2290 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2317-2338 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:2577 — app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:2577-2598 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3863-3889 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:19133 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:19133-19154 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:19159-19184 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) app/src/main/java/com/example/llamadroid/service/SdIpAdapterSupport.kt:190 — app/src/main/java/com/example/llamadroid/service/SdIpAdapterSupport.kt:190-216 | app/src/main/java/com/example/llamadroid/service/WhisperVadSupport.kt:222-243 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:748 — app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:748-769 | app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:973-994 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskService.kt:134 — app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskService.kt:134-158 | app/src/main/java/com/example/llamadroid/service/LlamaServerSessionService.kt:145-166 — 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 · Duplicated block (13 lines × 3) · ×7
  • Duplicated block (13 lines × 3) app/src/main/java/com/example/llamadroid/service/DownloadService.kt:1839 — app/src/main/java/com/example/llamadroid/service/DownloadService.kt:1839-1851 | app/src/main/java/com/example/llamadroid/service/DownloadService.kt:1926-1938 | app/src/main/java/com/example/llamadroid/service/DownloadService.kt:2043-2055 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (13 lines × 3) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2113 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2113-2125 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2130-2142 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1532-1544 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2113` 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 × 3) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3991 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3991-4003 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4361-4373 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4407-4419 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3991` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4004` calls `Column`, `spacedBy` and `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4374` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:857 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:857-869 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:901-913 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:597-609 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt` and `app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:857` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:504 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:504-516 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:704-716 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1211-1223 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:504` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 3) app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:802 — app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:802-814 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1048-1060 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1569-1581 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:802` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) app/src/main/java/com/example/llamadroid/harness/HarnessRemoteProjectRunner.kt:526 — app/src/main/java/com/example/llamadroid/harness/HarnessRemoteProjectRunner.kt:526-538 | app/src/main/java/com/example/llamadroid/service/AgentLocalProjectRunner.kt:476-488 | app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:332-344 — 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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×7
  • Duplicated block (12 lines × 3) app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:691 — app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:691-702 | app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:731-742 | app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:759-770 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3842 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3842-3853 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3921-3932 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3991-4002 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3842` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:699 — app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:699-713 | app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:460-471 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:302-313 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:699` 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 × 3) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:859 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:859-870 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:898-909 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1008-1019 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:859` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:70 — app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:70-82 | app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:53-65 | app/src/main/java/com/example/llamadroid/ui/settings/WhisperSettingsScreen.kt:83-94 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/settings/WhisperSettingsScreen.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1702 — app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1702-1713 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1775-1786 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1945-1956 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1702` 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 × 3) wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:319 — wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:319-330 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:350-361 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:416-427 — 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 `wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:319` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D15 · Churn × Complexity Hotspots · Repeated repair · ×6
  • Repeated repair: app/src/main/java/com/example/llamadroid/data/model/DownloadTaskSupport.kt app/src/main/java/com/example/llamadroid/data/model/DownloadTaskSupport.kt:139 — app/src/main/java/com/example/llamadroid/data/model/DownloadTaskSupport.kt changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is DownloadTaskArtifacts.discoverStalePartFiles at line 139), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Fixed audio generation error and minor bugs in the download queue”; “Improved deepseek harness implementation, fully integrated with image generation through ADT and web search, synced projects created from the webUI and the app. Fixed a minor issue in image generation not being able to remove a selected image”; “Fix for Qwen Image + Minor deepseek ai agent fixes”; “Fixed audio gen bugs and model type override by users”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/data/model/DownloadTaskSupport.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCatalog.kt app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCatalog.kt:172 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCatalog.kt changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is NativeHarnessCatalogKt.parseHarnessLocalModelCatalog at line 172), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Fix for multiple runtimes not showing ADT models correctly”; “Easy chat mode + fixes for AI agent + improved pet simulation”; “Improved deepseek harness implementation, fully integrated with image generation through ADT and web search, synced projects created from the webUI and the app. Fixed a minor issue in image generation not being able to remove a selected image”; “Fix for Qwen Image + Minor deepseek ai agent fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCatalog.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/example/llamadroid/service/NativeChatKvCacheCoordinator.kt app/src/main/java/com/example/llamadroid/service/NativeChatKvCacheCoordinator.kt:177 — app/src/main/java/com/example/llamadroid/service/NativeChatKvCacheCoordinator.kt changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is NativeChatKvCacheCoordinator.withUtilitySlot at line 177), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Added shimeji mode to the pet, changed farm style. fixed FGS error, fixed lingbot, wan errors when decoding video”; “Fixed some chat llama native errors when handling the deepseek harness. Removed the pet simulated world. Fixed an issue with lingbot video generation. Updated binaries and in-app guide”; “Final redesign. Fixed some issues in chat llama native delegating work to the harness and passing files from the main chat”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/service/NativeChatKvCacheCoordinator.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/example/llamadroid/tama/db/TamaDatabase.kt app/src/main/java/com/example/llamadroid/tama/db/TamaDatabase.kt:58 — app/src/main/java/com/example/llamadroid/tama/db/TamaDatabase.kt changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is TamaDatabase.getInstance at line 58), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Added shimeji mode to the pet, changed farm style. fixed FGS error, fixed lingbot, wan errors when decoding video”; “Fixed some chat llama native errors when handling the deepseek harness. Removed the pet simulated world. Fixed an issue with lingbot video generation. Updated binaries and in-app guide”; “Fixed audio generation error and minor bugs in the download queue”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/tama/db/TamaDatabase.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/example/llamadroid/ui/settings/ChatKvCacheStorageCard.kt app/src/main/java/com/example/llamadroid/ui/settings/ChatKvCacheStorageCard.kt:162 — app/src/main/java/com/example/llamadroid/ui/settings/ChatKvCacheStorageCard.kt changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is ChatKvCacheStorageCardKt.namespaceLabelRes at line 162), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Added shimeji mode to the pet, changed farm style. fixed FGS error, fixed lingbot, wan errors when decoding video”; “Fixed some chat llama native errors when handling the deepseek harness. Removed the pet simulated world. Fixed an issue with lingbot video generation. Updated binaries and in-app guide”; “Final redesign. Fixed some issues in chat llama native delegating work to the harness and passing files from the main chat”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/settings/ChatKvCacheStorageCard.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessUiModel.kt app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessUiModel.kt:957 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessUiModel.kt changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is HarnessUiModelKt.boundedHarnessMessage at line 957), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Easy chat mode + fixes for AI agent + improved pet simulation”; “Improved deepseek harness implementation, fully integrated with image generation through ADT and web search, synced projects created from the webUI and the app. Fixed a minor issue in image generation not being able to remove a selected image”; “Fix for Qwen Image + Minor deepseek ai agent fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-02..2026-10-31, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-02 00:13:19 +01:00' --until='2026-10-31 00:13:19 +01:00' --full-history --no-merges -- app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessUiModel.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 (40 corresponding lines) · ×6
  • Edited copy of a member (40 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2679 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2679-2736 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:2154-2193 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:161 — app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:161-200 | app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:205-244 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) app/src/main/java/com/example/llamadroid/ui/components/DraftNumericTextFields.kt:41 — app/src/main/java/com/example/llamadroid/ui/components/DraftNumericTextFields.kt:41-80 | app/src/main/java/com/example/llamadroid/ui/components/DraftNumericTextFields.kt:158-201 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaArtworkManager.kt:111 — app/src/main/java/com/example/llamadroid/tama/game/TamaArtworkManager.kt:111-156 | app/src/main/java/com/example/llamadroid/tama/game/TamaArtworkManager.kt:172-211 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeInstallations.kt:685 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeInstallations.kt:685-724 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeInstallations.kt:781-826 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatListScreen.kt:1442 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatListScreen.kt:1442-1482 | app/src/main/java/com/example/llamadroid/ui/components/SdSchedulerPicker.kt:26-65 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×6
  • Edited copies of one member (3 members, 9+ corresponding lines) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2710 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2710-2718 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2798-2806 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2930-2938 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferClient.kt:95 — app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferClient.kt:95-103 | app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferClient.kt:125-133 | app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferClient.kt:135-143 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3841 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3841-3849 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2101-2109 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:951-961 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:424 — app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:424-432 | app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:439-447 | app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:455-463 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) app/src/main/java/com/example/llamadroid/tama/data/TamaQuest.kt:163 — app/src/main/java/com/example/llamadroid/tama/data/TamaQuest.kt:163-172 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:607-615 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3919-3928 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:1599 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:1599-1616 | app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:1029-1038 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2384-2392 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×6
  • Duplicated block (27 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:475 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:475-501 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:291-317 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt` and `app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (27 lines × 2) app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:239 — app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:239-265 | app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:296-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (27 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1084 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1084-1110 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1254-1280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (27 lines × 2) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:537 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:537-563 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:638-664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:537` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (27 lines × 2) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1246 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1246-1272 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1378-1404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1246` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (27 lines × 2) app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkHistoryScreen.kt:352 — app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkHistoryScreen.kt:352-378 | app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkHistoryScreen.kt:509-535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkHistoryScreen.kt:352` 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×6
  • Duplicated block (12–13 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:581 — app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:581-592 | app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:707-719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:581` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) app/src/main/java/com/example/llamadroid/service/bubble/ChatBubbleOverlayService.kt:269 — app/src/main/java/com/example/llamadroid/service/bubble/ChatBubbleOverlayService.kt:269-280 | app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiOverlayService.kt:277-289 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12–13 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:620 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:620-632 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5623-5634 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:620` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3044 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3044-3056 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3331-3342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3044` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:761 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:761-772 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6011-6023 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:761` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1434 — app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1434-1446 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1476-1487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1434` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×5
  • Edited copy of a member (29 corresponding lines) app/src/main/java/com/example/llamadroid/service/MangaPaintedOcrSupport.kt:301 — app/src/main/java/com/example/llamadroid/service/MangaPaintedOcrSupport.kt:301-329 | app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:888-920 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/chatlist/NewChatSheet.kt:316 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chatlist/NewChatSheet.kt:316-344 | app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/ServerPickerSheet.kt:156-189 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1080 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1080-1108 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatComposer.kt:38-66 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:381 — app/src/main/java/com/example/llamadroid/service/ProcessController.kt:381-416 | app/src/main/java/com/example/llamadroid/service/SdDistributedRuntime.kt:416-444 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt:46 — app/src/main/java/com/example/llamadroid/service/MangaTranslationForegroundService.kt:46-74 | app/src/main/java/com/example/llamadroid/service/MediaTranslationForegroundService.kt:49-77 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 8+ corresponding lines) app/src/main/java/com/example/llamadroid/service/OnnxBackgroundRemovalService.kt:394 — app/src/main/java/com/example/llamadroid/service/OnnxBackgroundRemovalService.kt:394-401 | app/src/main/java/com/example/llamadroid/service/OnnxImageGenerationService.kt:573-582 | app/src/main/java/com/example/llamadroid/service/OnnxTtsGenerationService.kt:265-272 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:745 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:745-752 | app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:754-763 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:493-500 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:883 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:883-891 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:893-900 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:908-915 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1253 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1253-1260 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskRunner.kt:453-462 | app/src/main/java/com/example/llamadroid/service/delegation/DelegateSubagentLoop.kt:41-49 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) app/src/main/java/com/example/llamadroid/data/model/library/RoomModelDeletionJournal.kt:285 — app/src/main/java/com/example/llamadroid/data/model/library/RoomModelDeletionJournal.kt:285-292 | app/src/main/java/com/example/llamadroid/sd/SdLora.kt:67-74 | app/src/main/java/com/example/llamadroid/service/DatasetRuntimeSupport.kt:245-252 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×5
  • Edited copy of a member (3 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessTransferPublication.kt:312 — app/src/main/java/com/example/llamadroid/harness/HarnessTransferPublication.kt:312-314 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:429-433 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaConfig.kt:145 — app/src/main/java/com/example/llamadroid/service/LlamaConfig.kt:145-147 | app/src/main/java/com/example/llamadroid/service/LlamaServerLaunchProfile.kt:230-232 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:512 — app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:512-514 | app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:561-565 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) app/src/main/java/com/example/llamadroid/service/filestation/api/EditorApi.kt:169 — app/src/main/java/com/example/llamadroid/service/filestation/api/EditorApi.kt:169-171 | app/src/main/java/com/example/llamadroid/service/filestation/volume/VolumeRegistry.kt:188-190 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:1101 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:1101-1103 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt:252-254 — 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 · Duplicated block (29 lines × 2) · ×5
  • Duplicated block (29 lines × 2) app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:962 — app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:962-990 | app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:1115-1143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:962` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:991` calls `log` and `app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:1144` 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 (29 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1163 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1163-1191 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1337-1365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1163` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1495 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1495-1523 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1764-1792 — both copies are in the same file, so extract the 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 (29 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:354 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:354-382 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:628-656 — both copies are in the same file, so extract the 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 (29 lines × 2) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:880 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:880-908 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:990-1018 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:880` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:989` calls `Spacer`, `height` and `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:879` 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.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×5
  • Duplicated block (22 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:715 — app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:715-736 | app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:766-787 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:715` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:521 — app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:521-542 | app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:1003-1024 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4279 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4279-4300 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4538-4559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4279` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/GenerationBatteryOptimization.kt:255 — app/src/main/java/com/example/llamadroid/ui/ai/GenerationBatteryOptimization.kt:255-276 | app/src/main/java/com/example/llamadroid/ui/ai/GenerationBatteryOptimization.kt:285-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/GenerationBatteryOptimization.kt: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.
  • Duplicated block (22 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:356 — app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:356-377 | app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:542-563 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt` and `app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:356` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×5
  • Duplicated block (18–19 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:107 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:107-125 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:62-79 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt` and `app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–19 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaServerLauncher.kt:190 — app/src/main/java/com/example/llamadroid/service/LlamaServerLauncher.kt:190-208 | app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:699-716 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LlamaServerLauncher.kt:190` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–19 lines × 2) app/src/main/java/com/example/llamadroid/service/OnnxImageGenerationService.kt:291 — app/src/main/java/com/example/llamadroid/service/OnnxImageGenerationService.kt:291-309 | app/src/main/java/com/example/llamadroid/service/OnnxImageGenerationService.kt:315-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/OnnxImageGenerationService.kt:291` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (18–19 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1981 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1981-1998 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2124-2142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1981` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–19 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2954 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2954-2972 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:3251-3268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2954` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:3269` calls `isNotEmpty` and `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2973` 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×5
  • Duplicated block (14–15 lines × 2) app/src/main/java/com/example/llamadroid/service/QuadtrixTrainingService.kt:129 — app/src/main/java/com/example/llamadroid/service/QuadtrixTrainingService.kt:129-143 | app/src/main/java/com/example/llamadroid/service/QuadtrixTrainingService.kt:186-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/QuadtrixTrainingService.kt:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14–15 lines × 2) app/src/main/java/com/example/llamadroid/service/SSHService.kt:630 — app/src/main/java/com/example/llamadroid/service/SSHService.kt:630-644 | app/src/main/java/com/example/llamadroid/service/SSHService.kt:715-728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/SSHService.kt:630` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14–15 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessModelEditor.kt:317 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessModelEditor.kt:317-330 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1524-1538 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessModelEditor.kt:317` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:680 — app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:680-694 | app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:848-861 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:680` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:241 — app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:241-255 | app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:337-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×5
  • Duplicated block (14 lines × 3) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1819 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1819-1832 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1925-1938 | app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1952-1965 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1819` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1464 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1464-1477 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:543-556 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:348-361 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1464` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1518 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1518-1531 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:377-390 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:393-406 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1518` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 3) app/src/main/java/com/example/llamadroid/ui/pdf/PDFSummaryScreen.kt:273 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFSummaryScreen.kt:273-286 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFSummaryScreen.kt:291-304 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFSummaryScreen.kt:404-417 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 3) app/src/main/java/com/example/llamadroid/service/AgentService.kt:10487 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:10487-10500 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:10591-10604 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:10623-10636 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:10487` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×5
  • Duplicated block (11–12 lines × 2) app/src/main/java/com/example/llamadroid/service/OllamaService.kt:155 — app/src/main/java/com/example/llamadroid/service/OllamaService.kt:155-165 | app/src/main/java/com/example/llamadroid/service/OllamaService.kt:758-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 2) app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:375 — app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:375-385 | app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:595-606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:375` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:607` calls `toString` and `app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:386` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11–12 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1035 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1035-1045 | app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:1457-1468 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1035` 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–12 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:591 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:591-601 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5944-5955 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:591` 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–12 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:740 — app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:740-751 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7460-7470 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:740` 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.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:571 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:571-579 | app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:357-365 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:4129-4137 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt` and `app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:571` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2840 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:2840-2848 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:2995-3003 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:7634-7642 — 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. The matched lines also transfer control out of the body holding them, which cannot 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) app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:173 — app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:173-181 | app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:383-391 | app/src/main/java/com/example/llamadroid/service/VideoReusePayload.kt:355-363 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:392` calls `put`, `toJsonArray` and `app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:182` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:318 — wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:318-326 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:349-357 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:442-450 — 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 `wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:163 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:163-179 | app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:65-81 | app/src/main/java/com/example/llamadroid/service/ZimShareService.kt:65-73 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/service/ModelShareService.kt` and `app/src/main/java/com/example/llamadroid/service/ZimShareService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:163` 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×5
  • Duplicated block (8–9 lines × 2) app/src/main/java/com/example/llamadroid/data/runtime/AgentRuntimeProfileSupport.kt:125 — app/src/main/java/com/example/llamadroid/data/runtime/AgentRuntimeProfileSupport.kt:125-132 | app/src/main/java/com/example/llamadroid/data/runtime/AgentRuntimeProfileSupport.kt:180-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/runtime/AgentRuntimeProfileSupport.kt:125` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:139 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:139-147 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:187-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:139` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8–9 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4935 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4935-4942 | app/src/main/java/com/example/llamadroid/widget/TamaPetWidget.kt:320-328 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8–9 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3700 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3700-3708 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4114-4121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3700` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8–9 lines × 2) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2739 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2739-2747 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:3383-3390 — 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 `wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:3383` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×5
  • Duplicated block (8 lines × 3) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3002 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3002-3009 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3986-3993 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4041-4048 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3002` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1232 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1232-1239 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2105-2112 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:406-413 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1232` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:732 — app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:732-739 | app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:910-917 | app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:1052-1059 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:732` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:3749 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:3749-3756 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:3758-3765 | app/src/main/java/com/example/llamadroid/tama/game/TamaStudySessionSupport.kt:311-318 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 3) app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:133 — app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:133-140 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:967-974 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1187-1194 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×5
  • Duplicated block (5 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:870 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:870-874 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3955-3959 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6992-6996 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3955` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) app/src/main/java/com/example/llamadroid/onnx/OnnxBackgroundRemovalSupport.kt:154 — app/src/main/java/com/example/llamadroid/onnx/OnnxBackgroundRemovalSupport.kt:154-158 | app/src/main/java/com/example/llamadroid/onnx/OnnxModelSupport.kt:515-521 | app/src/main/java/com/example/llamadroid/onnx/OnnxTtsSupport.kt:137-141 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 3) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2260 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2260-2264 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1595-1599 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1611-1615 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1611` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) app/src/main/java/com/example/llamadroid/ui/agent/AgentSkillManager.kt:78 — app/src/main/java/com/example/llamadroid/ui/agent/AgentSkillManager.kt:78-82 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:169-173 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:248-254 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) app/src/main/java/com/example/llamadroid/service/OnnxBackgroundRemovalService.kt:397 — app/src/main/java/com/example/llamadroid/service/OnnxBackgroundRemovalService.kt:397-401 | app/src/main/java/com/example/llamadroid/service/OnnxImageGenerationService.kt:576-582 | app/src/main/java/com/example/llamadroid/service/OnnxTtsGenerationService.kt:268-272 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/OnnxBackgroundRemovalService.kt:397` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×5
  • Low cohesion: AgentService (LCOM4 6) app/src/main/java/com/example/llamadroid/service/AgentService.kt:301 — AgentService'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: BaseRemoteSummaryClient (LCOM4 5) app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:530 — BaseRemoteSummaryClient'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: LiteRtLmReflectionBridge (LCOM4 4) app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:1068 — LiteRtLmReflectionBridge'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: TamaGameEngine (LCOM4 4) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:64 — TamaGameEngine'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: NativeHarnessParityController (LCOM4 4) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessParityController.kt:28 — NativeHarnessParityController'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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×5
  • Sync-over-async blocking app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:3075 — `generateWebChatReply` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1669 — `streamOllamaResponse` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1908 — `streamNativeToolResponse` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking app/src/main/java/com/example/llamadroid/service/RemoteSummaryOrchestrator.kt:183 — `unifyRecursively` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking app/src/main/java/com/example/llamadroid/service/RemoteSummaryOrchestrator.kt:336 — `splitForBudget` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×4
  • Edited copy of a member (32 corresponding lines) app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:2456 — app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:2456-2487 | app/src/main/java/com/example/llamadroid/service/chat/ThinkingTags.kt:10-41 — 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) app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:137 — app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:137-168 | app/src/main/java/com/example/llamadroid/service/VideoMediaProcessor.kt:180-213 — 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) app/src/main/java/com/example/llamadroid/tama/ui/AdventureSettingsDialog.kt:373 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureSettingsDialog.kt:373-414 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureSettingsDialog.kt:422-453 — 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) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessSettingsNavigation.kt:529 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessSettingsNavigation.kt:529-565 | app/src/main/java/com/example/llamadroid/ui/search/GlobalSearchScreen.kt:331-362 — 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 (31 corresponding lines) · ×4
  • Edited copy of a member (31 corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1592 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1592-1622 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1636-1667 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) app/src/main/java/com/example/llamadroid/service/DeepResearchService.kt:449 — app/src/main/java/com/example/llamadroid/service/DeepResearchService.kt:449-480 | app/src/main/java/com/example/llamadroid/service/KnowledgeBaseIndexingService.kt:233-263 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:3706 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:3706-3736 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:3738-3768 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:18850 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:18850-18889 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:18962-18992 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×4
  • Edited copy of a member (20 corresponding lines) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2735 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2735-2756 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2758-2777 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) app/src/main/java/com/example/llamadroid/service/PDFService.kt:1768 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:1768-1789 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:4977-4996 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessWorkspaceRepository.kt:253 — app/src/main/java/com/example/llamadroid/harness/HarnessWorkspaceRepository.kt:253-272 | app/src/main/java/com/example/llamadroid/harness/HarnessWorkspaceRepository.kt:308-329 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:5197 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:5197-5216 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:8132-8151 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×4
  • Edited copy of a member (25 corresponding lines) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:417 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:417-441 | app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:1962-1988 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/transfer/TamaPairedDevices.kt:206 — app/src/main/java/com/example/llamadroid/tama/ui/transfer/TamaPairedDevices.kt:206-231 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatDelegationSettingsSection.kt:331-355 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4557 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4557-4585 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4601-4625 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1563 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1563-1587 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1772-1796 — 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 copy of a member (24 corresponding lines) · ×4
  • Edited copy of a member (24 corresponding lines) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2292 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2292-2315 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2340-2367 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:631 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:631-654 | app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:456-481 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1562 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1562-1585 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1209-1240 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsSections.kt:130 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsSections.kt:130-158 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsSections.kt:849-872 — 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 copies of one member (3 members, 18+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 18+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/LiveTranslatorScreen.kt:1274 — app/src/main/java/com/example/llamadroid/ui/ai/LiveTranslatorScreen.kt:1274-1297 | app/src/main/java/com/example/llamadroid/ui/ai/SdBackendPlacementControls.kt:48-65 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5739-5763 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:162 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:162-184 | app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:147-170 | app/src/main/java/com/example/llamadroid/service/SdDistributedService.kt:408-425 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:426 — app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:426-444 | app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:450-468 | app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:470-487 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:5294 — app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:5294-5315 | app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:5375-5392 | app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:5394-5411 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×4
  • Duplicated block (28 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:12047 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:12047-12074 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:12962-12989 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:12047` it begins part-way through the construct above it, so those 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 (28 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:3968 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:3968-3995 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4001-4028 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:3968` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (28 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:2898 — app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:2898-2925 | app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3031-3058 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:2898` 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 (28 lines × 2) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1308 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1308-1335 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1426-1453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1454` calls `toLongOrNull` and `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1336` 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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×4
  • Duplicated block (25 lines × 2) app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:689 — app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:689-713 | app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:729-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:689` 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 (25 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:12217 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:12217-12241 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:12325-12349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:12217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (25 lines × 2) app/src/main/java/com/example/llamadroid/service/DatasetBackendSupport.kt:82 — app/src/main/java/com/example/llamadroid/service/DatasetBackendSupport.kt:82-106 | app/src/main/java/com/example/llamadroid/service/DatasetBackendSupport.kt:170-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/DatasetBackendSupport.kt:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (25 lines × 2) app/src/main/java/com/example/llamadroid/tama/game/TamaMemorySupport.kt:190 — app/src/main/java/com/example/llamadroid/tama/game/TamaMemorySupport.kt:190-214 | app/src/main/java/com/example/llamadroid/tama/game/TamaMemorySupport.kt:217-241 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×4
  • Duplicated block (23 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:905 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:905-927 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:3635-3657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt: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. The matched lines also transfer control out of the body holding them, which cannot 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) app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:371 — app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:371-393 | app/src/main/java/com/example/llamadroid/service/VideoReusePayload.kt:343-365 — 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 (23 lines × 2) app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiChatActivity.kt:71 — app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiChatActivity.kt:71-93 | app/src/main/java/com/example/llamadroid/ui/bubble/ChatBubbleActivity.kt:53-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiChatActivity.kt:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1779 — app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1779-1801 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1949-1971 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1779` 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×4
  • Duplicated block (9–11 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:993 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:993-1003 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:1211-1219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:993` it begins part-way through the construct above it, so those exact lines 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–11 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:226 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:226-234 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5921-5931 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:226` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–11 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:3869 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:3869-3877 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4351-4361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:3869` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–11 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:4518 — app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:4518-4526 | app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:5060-5070 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:4518` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×4
  • Duplicated block (9 lines × 4) app/src/main/java/com/example/llamadroid/service/AgentLocalProjectRunner.kt:446 — app/src/main/java/com/example/llamadroid/service/AgentLocalProjectRunner.kt:446-454 | app/src/main/java/com/example/llamadroid/service/AgentLocalProjectRunner.kt:461-469 | app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:269-277 | app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:284-292 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 4) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1955 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1955-1963 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2103-2111 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:295-303 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:800-808 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1955` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:468 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:468-476 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:554-562 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:655-663 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1081-1089 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:468` 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 × 4) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:175 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:175-183 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:740-752 | app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:318-330 | app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:1032-1044 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:175` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×4
  • Duplicated block (5 lines × 4) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:789 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:789-793 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:869-873 | app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:1653-1657 | app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:408-412 — 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 (5 lines × 4) app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:624 — app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:624-631 | app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:575-583 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5308-5312 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7235-7239 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:624` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7231` calls `Spacer`, `height` and `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5306` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 4) app/src/main/java/com/example/llamadroid/ui/agent/AgentNewProjectDialog.kt:34 — app/src/main/java/com/example/llamadroid/ui/agent/AgentNewProjectDialog.kt:34-38 | app/src/main/java/com/example/llamadroid/ui/agent/AgentPlanEditorDialog.kt:42-46 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:1574-1579 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:1849-1854 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentNewProjectDialog.kt:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 4) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:783 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:783-787 | app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:559-563 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2243-2247 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1584-1588 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt` and `app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
DM10 · One transaction, one aggregate · One operation mutates 2 aggregates · ×4
  • One operation mutates 2 aggregates: OnnxTtsGenerationService.startGeneration app/src/main/java/com/example/llamadroid/service/OnnxTtsGenerationService.kt:149 — `OnnxTtsGenerationService.startGeneration` saves `Idle`, `Error` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
  • One operation mutates 2 aggregates: PetTransferCoordinator.reclaimAnyway app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:383 — `PetTransferCoordinator.reclaimAnyway` saves `TransferState`, `Nothing` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
  • One operation mutates 2 aggregates: PetTransferCoordinator.abandon app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:402 — `PetTransferCoordinator.abandon` saves `TransferState`, `Nothing` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
  • One operation mutates 2 aggregates: PetTransferReceiveCommit.recoverInterrupted app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferReceiveCommit.kt:117 — `PetTransferReceiveCommit.recoverInterrupted` saves `Nothing`, `TransferState` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×4
  • Outbound HTTP without resilience app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:117 — `Retrofit.Builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/src/main/java/com/example/llamadroid/data/model/library/ModelLibraryRepositoryFactory.kt:15 — `Retrofit.Builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/src/main/java/com/example/llamadroid/data/proot/ProotManager.kt:81 — `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:269 — `Retrofit.Builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×3
  • Animation without a prefers-reduced-motion guard app/src/main/assets/ai_servers_webui/styles.css:257 — `.upload-progress div` moves (`transition: width 160ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard app/src/main/assets/ai_servers_webui/styles.css:432 — `.progress-track div` moves (`transition: width 220ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard app/src/main/assets/ai_servers_webui/styles.css:527 — `.hub-server-card` moves (`transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D4 · Code Duplication · Edited copy of a member (45 corresponding lines) · ×3
  • Edited copy of a member (45 corresponding lines) app/src/main/java/com/example/llamadroid/tama/adventure/AdventureService.kt:572 — app/src/main/java/com/example/llamadroid/tama/adventure/AdventureService.kt:572-616 | app/src/main/java/com/example/llamadroid/tama/adventure/AdventureService.kt:623-676 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1320 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1320-1364 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsControls.kt:168-214 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:1627 — app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:1627-1671 | app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:1680-1733 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×3
  • Edited copy of a member (42 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmMaterialUi.kt:152 — app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmMaterialUi.kt:152-193 | app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmTileOverlay.kt:220-263 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5785 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5785-5826 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:2333-2381 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:306 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:306-348 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:379-420 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×3
  • Edited copy of a member (30 corresponding lines) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2648 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2648-2678 | app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:1036-1065 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) app/src/main/java/com/example/llamadroid/service/PDFService.kt:5343 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:5343-5372 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:5431-5462 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1413 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1413-1449 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1156-1185 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×3
  • Edited copy of a member (33 corresponding lines) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3696 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3696-3728 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3980-4025 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) app/src/main/java/com/example/llamadroid/ui/components/SharedSettingsComponents.kt:30 — app/src/main/java/com/example/llamadroid/ui/components/SharedSettingsComponents.kt:30-62 | app/src/main/java/com/example/llamadroid/ui/components/SharedSettingsComponents.kt:78-110 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:688 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:688-720 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5699-5732 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 10+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/settings/StatsScreen.kt:292 — app/src/main/java/com/example/llamadroid/ui/settings/StatsScreen.kt:292-302 | app/src/main/java/com/example/llamadroid/ui/settings/StatsScreen.kt:305-315 | app/src/main/java/com/example/llamadroid/ui/settings/StatsScreen.kt:342-351 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:336 — app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:336-346 | app/src/main/java/com/example/llamadroid/harness/HarnessRootfsFileStore.kt:614-623 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeEnvironment.kt:423-434 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessCredentialStore.kt:162 — app/src/main/java/com/example/llamadroid/harness/HarnessCredentialStore.kt:162-171 | app/src/main/java/com/example/llamadroid/harness/HarnessTransferPublication.kt:328-337 | app/src/main/java/com/example/llamadroid/tama/transfer/PeerKeyStore.kt:30-42 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×3
  • Edited copy of a member (21 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:609 — app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:609-629 | app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:1318-1347 — 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) app/src/main/java/com/example/llamadroid/service/HarnessRecoveryTerminalSessionManager.kt:399 — app/src/main/java/com/example/llamadroid/service/HarnessRecoveryTerminalSessionManager.kt:399-420 | app/src/main/java/com/example/llamadroid/service/HarnessRecoveryTerminalSessionManager.kt:427-447 — 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) app/src/main/java/com/example/llamadroid/harness/client/OkHttpHarnessClient.kt:827 — app/src/main/java/com/example/llamadroid/harness/client/OkHttpHarnessClient.kt:827-847 | app/src/main/java/com/example/llamadroid/harness/client/OkHttpHarnessClient.kt:849-870 — 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 copies of one member (3 members, 14+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 14+ corresponding lines) app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:247 — app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:247-260 | app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:262-275 | app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:277-290 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:1002 — app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:1002-1016 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:1024-1037 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:1046-1060 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2080 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2080-2095 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:930-945 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chatlist/WearQuickChatSettingsDialog.kt:200-213 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×3
  • Duplicated block (35 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2903 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:2903-2937 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:3066-3100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:2903` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (35 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:3180 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:3180-3214 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:3287-3321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:3180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (35 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:387 — app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:387-421 | app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:574-608 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt` and `app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:387` 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.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×3
  • Duplicated block (26 lines × 2) app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:162 — app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:162-187 | app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:206-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (26 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:492 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:492-517 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2074-2099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:492` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:3913 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:3913-3938 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:4041-4066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×3
  • Duplicated block (23–24 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:602 — app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:602-625 | app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:675-697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:602` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23–24 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6301 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6301-6323 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7135-7158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6301` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (23–24 lines × 2) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1987 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1987-2010 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2119-2141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1987` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2117` calls `ErrorText`, `stringResource` and `wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1986` 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.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×3
  • Duplicated block (22–23 lines × 2) app/src/main/java/com/example/llamadroid/data/model/ModelLibraryManager.kt:66 — app/src/main/java/com/example/llamadroid/data/model/ModelLibraryManager.kt:66-88 | app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:272-293 — 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 (22–23 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1613 — app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1613-1635 | app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1708-1729 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1613` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1611` calls `rememberScrollState` and `app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1707` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (22–23 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:1966 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:1966-1987 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2163-2185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×3
  • Duplicated block (20 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:667 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:667-686 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsEnvFactory.kt:27-46 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt:142-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (20 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:63 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:63-82 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:269-288 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:562-581 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:384 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:384-403 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:666-685 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:400-419 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt` and `app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 · Duplicated block (17–19 lines × 2) · ×3
  • Duplicated block (17–19 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaService.kt:384 — app/src/main/java/com/example/llamadroid/service/LlamaService.kt:384-402 | app/src/main/java/com/example/llamadroid/service/LlamaService.kt:550-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17–19 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1120 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1120-1138 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageMedia.kt:66-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1120` 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 (17–19 lines × 2) app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:339 — app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:339-357 | app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:1766-1782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:339` 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.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×3
  • Duplicated block (15–18 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:870 — app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:870-887 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1407-1421 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:870` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–18 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2361 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2361-2375 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:491-508 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2361` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–18 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:472 — app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:472-489 | app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:653-667 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt` and `app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 · Duplicated block (32 lines × 2) · ×3
  • Duplicated block (32 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6245 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6245-6276 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7078-7109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (32 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaService.kt:336 — app/src/main/java/com/example/llamadroid/service/LlamaService.kt:336-367 | app/src/main/java/com/example/llamadroid/service/LlamaService.kt:513-544 — both copies are in the same file, so extract the 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 (32 lines × 2) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2099 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2099-2130 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2237-2268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2099` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2133` calls `appendLine` and `app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2271` 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.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×3
  • Duplicated block (15 lines × 3) app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:938 — app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:938-952 | app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:1058-1072 | app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:1171-1185 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:938` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1068 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1068-1082 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1113-1127 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1199-1213 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1068` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1083` calls `importMask` and `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1128` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4652 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4652-4666 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2979-2993 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:3266-3280 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4652` 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.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×3
  • Duplicated block (9–12 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1794 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1794-1802 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1883-1894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1794` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1791` calls `clip`, `RoundedCornerShape`, `background` and `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1882` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9–12 lines × 2) app/src/main/java/com/example/llamadroid/ui/LlamaApp.kt:909 — app/src/main/java/com/example/llamadroid/ui/LlamaApp.kt:909-920 | app/src/main/java/com/example/llamadroid/ui/LlamaApp.kt:1096-1104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–12 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:2855 — app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:2855-2863 | app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:2990-3001 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:2855` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×3
  • Duplicated block (10–12 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3921 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3921-3930 | app/src/main/java/com/example/llamadroid/ui/models/AudioModelsScreen.kt:82-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3921` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–12 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5352 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5352-5363 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:1068-1077 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10–12 lines × 2) app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundlePicker.kt:244 — app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundlePicker.kt:244-253 | app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:539-550 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundlePicker.kt` and `app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundlePicker.kt:244` 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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×3
  • Duplicated block (11 lines × 4) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMath.kt:72 — app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMath.kt:72-82 | app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMath.kt:95-105 | app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMath.kt:119-129 | app/src/main/java/com/example/llamadroid/audio/music/StableAudio3LoraMath.kt:130-140 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 4) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:178 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:178-188 | app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:927-937 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1455-1465 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatScreenSupport.kt:103-113 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:926` calls `clearFeedback` and `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1454` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 4) wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:324 — wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:324-334 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:355-365 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:390-400 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:421-431 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:324` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1659 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1659-1668 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1729-1739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1659` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3867 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3867-3877 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3948-3957 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3867` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:1132 — app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:1132-1141 | app/src/main/java/com/example/llamadroid/ui/models/ModelShareScreen.kt:113-123 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:1132` 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×3
  • Duplicated block (9–10 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:6166 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:6166-6175 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:6562-6570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:6166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:287 — app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:287-295 | app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:380-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–10 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1547 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1547-1556 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1771-1779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1547` 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.
DM4 · Rich vs anemic model · Anemic entity · ×3
  • Anemic entity: BenchmarkResult app/src/main/java/com/example/llamadroid/data/db/BenchmarkResult.kt:11 — `BenchmarkResult` is an aggregate/entity with 11 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: SavedCommand app/src/main/java/com/example/llamadroid/data/db/SavedCommandEntity.kt:21 — `SavedCommand` is an aggregate/entity with 46 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: SavedWorker app/src/main/java/com/example/llamadroid/data/model/SavedWorker.kt:11 — `SavedWorker` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
D4 · Code Duplication · Near-duplicate member pair (55 shared lines) · ×2
  • Near-duplicate member pair (55 shared lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1409 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1409-1653 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:267-515 — These two members are variants of one another: 55 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (55 shared lines) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2029 — app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2029-2149 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2158-2284 — These two members are variants of one another: 55 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 (8 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (8 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:379 — app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:379-472 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:474-557 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:806-877 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:882-927 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:932-978 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:986-1036 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1042-1091 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1097-1165 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:863 — app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:863-1050 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1059-1122 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1195-1215 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1224-1261 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1296-1333 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1346-1397 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1403-1437 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1447-1474 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (7 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:54 — app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:54-200 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3863-3873 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4671-4686 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6781-6796 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2123-2133 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:975-985 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4651-4666 — 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) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:721 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:721-2272 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1521-2669 | app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:884-1088 | app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:1334-1699 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:160-942 | app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkHistoryScreen.kt:66-294 | app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:1248-1513 — 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 · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:875 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:875-2450 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3471-3672 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:61-221 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:267-515 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:319-530 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:72 — app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:72-98 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:114-139 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:156-196 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:259-285 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:295-321 — 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 (72 corresponding lines) · ×2
  • Edited copy of a member (72 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4598 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4598-4669 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2916-2995 — 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.
  • Edited copy of a member (72 corresponding lines) app/src/main/java/com/example/llamadroid/service/SSHService.kt:615 — app/src/main/java/com/example/llamadroid/service/SSHService.kt:615-687 | app/src/main/java/com/example/llamadroid/service/SSHService.kt:698-769 — 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 (68 corresponding lines) · ×2
  • Edited copy of a member (68 corresponding lines) app/src/main/java/com/example/llamadroid/ui/settings/WelcomeScreen.kt:246 — app/src/main/java/com/example/llamadroid/ui/settings/WelcomeScreen.kt:246-313 | app/src/main/java/com/example/llamadroid/ui/settings/WelcomeScreen.kt:319-408 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (68 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:701 — app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:701-775 | app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:1355-1422 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (55 corresponding lines) · ×2
  • Edited copy of a member (55 corresponding lines) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1293 — app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1293-1347 | app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1421-1488 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (55 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3585 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3585-3639 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskRunner.kt:368-424 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (46 corresponding lines) · ×2
  • Edited copy of a member (46 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:304 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:304-349 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:385-440 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (46 corresponding lines) app/src/main/java/com/example/llamadroid/service/PDFSummaryLogic.kt:103 — app/src/main/java/com/example/llamadroid/service/PDFSummaryLogic.kt:103-148 | app/src/main/java/com/example/llamadroid/service/PDFSummaryLogic.kt:329-385 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×2
  • Edited copy of a member (27 corresponding lines) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1274 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1274-1300 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1310-1342 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:712 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:712-756 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4111-4137 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×2
  • Edited copy of a member (23 corresponding lines) app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:343 — app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:343-371 | app/src/main/java/com/example/llamadroid/service/NativeVideoRecognitionRuntime.kt:407-429 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentToolSchemaPolicy.kt:148 — app/src/main/java/com/example/llamadroid/service/AgentToolSchemaPolicy.kt:148-170 | app/src/main/java/com/example/llamadroid/service/AgentToolSchemaPolicy.kt:174-198 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×2
  • Edited copy of a member (41 corresponding lines) app/src/main/java/com/example/llamadroid/util/ProcessUtils.kt:25 — app/src/main/java/com/example/llamadroid/util/ProcessUtils.kt:25-65 | app/src/main/java/com/example/llamadroid/util/ProcessUtils.kt:75-115 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:5413 — app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:5413-5453 | app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:5455-5499 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 27+ corresponding lines) app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:424 — app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:424-450 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:629-662 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1443-1469 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 27+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/walkthrough/FeatureMediaModelGuides.kt:433 — app/src/main/java/com/example/llamadroid/ui/walkthrough/FeatureMediaModelGuides.kt:433-463 | app/src/main/java/com/example/llamadroid/ui/walkthrough/FeatureOtherGuides.kt:631-657 | app/src/main/java/com/example/llamadroid/ui/walkthrough/FeatureTamaGuides.kt:201-227 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 12+ corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2147 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2147-2164 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2225-2238 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2264-2275 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentSleepWakeScheduler.kt:145 — app/src/main/java/com/example/llamadroid/service/AgentSleepWakeScheduler.kt:145-157 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskScheduler.kt:158-170 | app/src/main/java/com/example/llamadroid/service/OrganizerAlarmScheduler.kt:90-101 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 20+ corresponding lines) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:524 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:524-543 | app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:549-568 | app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:334-354 — 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.
  • Edited copies of one member (3 members, 20+ corresponding lines) app/src/main/java/com/example/llamadroid/service/DistributedMasterLlamaService.kt:265 — app/src/main/java/com/example/llamadroid/service/DistributedMasterLlamaService.kt:265-285 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:359-378 | app/src/main/java/com/example/llamadroid/service/LlamaService.kt:262-281 — 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 copies of one member (3 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1048 — app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1048-1058 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:5106-5116 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:7291-7303 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) app/src/main/java/com/example/llamadroid/service/GenerationQueueRepository.kt:229 — app/src/main/java/com/example/llamadroid/service/GenerationQueueRepository.kt:229-241 | app/src/main/java/com/example/llamadroid/service/GenerationQueueRepository.kt:256-266 | app/src/main/java/com/example/llamadroid/service/GenerationQueueRepository.kt:268-278 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2109 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2109-2125 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:2127-2142 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1529-1544 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) app/src/main/java/com/example/llamadroid/service/SubtitleBurnService.kt:111 — app/src/main/java/com/example/llamadroid/service/SubtitleBurnService.kt:111-126 | app/src/main/java/com/example/llamadroid/service/VideoInterpolationService.kt:843-860 | app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:158-174 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 12+ corresponding lines) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:2304 — app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:2304-2315 | app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:219-233 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeEnvironment.kt:288-302 | app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferDomains.kt:514-525 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1491 — app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1491-1502 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1504-1515 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1517-1528 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1530-1541 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 7+ corresponding lines) app/src/main/java/com/example/llamadroid/service/chat/ChatAdmissionPlanner.kt:89 — app/src/main/java/com/example/llamadroid/service/chat/ChatAdmissionPlanner.kt:89-95 | app/src/main/java/com/example/llamadroid/service/ephemeral/EphemeralLlamaServer.kt:168-177 | app/src/main/java/com/example/llamadroid/service/vision/VisionDescriptionService.kt:182-191 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) app/src/main/java/com/example/llamadroid/data/model/LiteRtModelEntity.kt:67 — app/src/main/java/com/example/llamadroid/data/model/LiteRtModelEntity.kt:67-73 | app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:1066-1072 | app/src/main/java/com/example/llamadroid/service/LiveTranslatorNativeRunner.kt:32-38 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 13+ corresponding lines) app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:249 — app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:249-265 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaServerViewModel.kt:233-245 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaServerViewModel.kt:247-259 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) app/src/main/java/com/example/llamadroid/service/OrganizerAlarmScheduler.kt:103 — app/src/main/java/com/example/llamadroid/service/OrganizerAlarmScheduler.kt:103-115 | app/src/main/java/com/example/llamadroid/widget/HomeWidgets.kt:51-63 | app/src/main/java/com/example/llamadroid/widget/NoteDisplayWidget.kt:69-81 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×2
  • Edited copy of a member (2 corresponding lines) app/src/main/java/com/example/llamadroid/data/repository/LlamaServerRegistry.kt:203 — app/src/main/java/com/example/llamadroid/data/repository/LlamaServerRegistry.kt:203-204 | app/src/main/java/com/example/llamadroid/service/ManagedLlamaServerCoordinator.kt:254-255 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) app/src/main/java/com/example/llamadroid/service/chat/NativeChatSteps.kt:90 — app/src/main/java/com/example/llamadroid/service/chat/NativeChatSteps.kt:90-91 | app/src/main/java/com/example/llamadroid/service/delegation/DelegationTaskOptions.kt:33-35 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×2
  • Edited copies of one member (3 members, 5+ corresponding lines) app/src/main/java/com/example/llamadroid/service/LiteRtGpuDiagnostics.kt:547 — app/src/main/java/com/example/llamadroid/service/LiteRtGpuDiagnostics.kt:547-555 | app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:628-636 | app/src/main/java/com/example/llamadroid/service/MediaModelSupport.kt:183-187 — 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.
  • Edited copies of one member (3 members, 5+ corresponding lines) app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:2217 — app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:2217-2221 | app/src/main/java/com/example/llamadroid/service/DeepResearchSupport.kt:304-308 | app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:3902-3906 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 6+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:2042 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:2042-2051 | app/src/main/java/com/example/llamadroid/ui/ai/QuadtrixTrainerScreen.kt:622-627 | app/src/main/java/com/example/llamadroid/ui/components/ModelStorageOverview.kt:79-84 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1582 — app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1582-1591 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2441-2446 | app/src/main/java/com/example/llamadroid/widget/TamaFarmWidget.kt:460-469 — 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 (1 corresponding lines) · ×2
  • Edited copy of a member (1 corresponding lines) app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:517 — app/src/main/java/com/example/llamadroid/service/SdGeneratedImageMetadata.kt:517-517 | app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:874-874 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:699 — wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:699-699 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1618-1618 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 · Duplicated block (34 lines × 2) · ×2
  • Duplicated block (34 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:460 — app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:460-493 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:302-335 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:460` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (34 lines × 2) app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:851 — app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:851-884 | app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:1021-1054 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:851` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×2
  • Duplicated block (33 lines × 2) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3586 — app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3586-3618 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskRunner.kt:369-401 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:3586` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (33 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:891 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:891-923 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:587-619 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt` and `app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×2
  • Duplicated block (31 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentImageOperations.kt:166 — app/src/main/java/com/example/llamadroid/service/AgentImageOperations.kt:166-196 | app/src/main/java/com/example/llamadroid/service/NativeChatUnifiedImageGenerator.kt:109-139 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (31 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:140 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:140-170 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:411-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×2
  • Duplicated block (27–28 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3783 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3783-3810 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2047-2073 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3783` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27–28 lines × 2) app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:270 — app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:270-297 | app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:363-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:270` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×2
  • Duplicated block (24–25 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1337 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1337-1360 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsControls.kt:184-208 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1337` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (24–25 lines × 2) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2017 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2017-2041 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2151-2174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2017` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:4107 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:4107-4130 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:4176-4199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (24 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1456 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1456-1479 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:535-558 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1456` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×2
  • Duplicated block (21–23 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1291 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1291-1313 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1866-1886 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1291` it does not close everything it opens, so those 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 (21–23 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1186 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1186-1208 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2062-2082 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1186` 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.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×2
  • Duplicated block (20–22 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2657 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2657-2676 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:3453-3474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:2657` it does not close everything it opens, so those exact lines 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–22 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6280 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6280-6299 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7112-7133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6280` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×2
  • Duplicated block (19–21 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:109 — app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:109-129 | app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:273-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19–21 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/QuadtrixWebUiScreen.kt:223 — app/src/main/java/com/example/llamadroid/ui/ai/QuadtrixWebUiScreen.kt:223-241 | app/src/main/java/com/example/llamadroid/ui/ai/TermuxWebViewScreen.kt:165-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/QuadtrixWebUiScreen.kt:223` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4704 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4704-4724 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6829-6849 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4704` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:1046 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:1046-1066 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:3674-3694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×2
  • Duplicated block (18–20 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4234 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4234-4253 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4942-4959 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (18–20 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:690 — app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:690-709 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:292-309 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:690` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) app/src/main/java/com/example/llamadroid/service/PDFService.kt:6010 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:6010-6027 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:6110-6125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/PDFService.kt:6010` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–18 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2095 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2095-2112 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1630-1645 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2095` 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.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4671 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4671-4686 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6781-6796 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4651-4666 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (16 lines × 3) app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1718 — app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1718-1733 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1791-1806 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1961-1976 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:1718` 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×2
  • Duplicated block (13–15 lines × 2) app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:405 — app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:405-419 | app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:443-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:405` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–15 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1116 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1116-1130 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1425-1437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×2
  • Duplicated block (12–15 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/WorkerModeScreen.kt:231 — app/src/main/java/com/example/llamadroid/ui/distributed/WorkerModeScreen.kt:231-245 | app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:1305-1316 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/WorkerModeScreen.kt:231` 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 (12–15 lines × 2) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2764 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2764-2778 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:3501-3512 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×2
  • Duplicated block (14 lines × 4) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:1984 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:1984-1997 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:117-130 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:331-344 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:347-360 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:1984` 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 × 4) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1004 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1004-1017 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1096-1109 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1140-1153 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1178-1191 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:1004` 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×2
  • Duplicated block (12–14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:306 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:306-317 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:259-272 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–14 lines × 2) app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2701 — app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2701-2712 | app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:1086-1099 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×2
  • Duplicated block (11–14 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2680 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2680-2693 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:2155-2165 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:2680` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–14 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2686 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2686-2699 | app/src/main/java/com/example/llamadroid/ui/library/AllMediaGalleryScreen.kt:617-627 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2686` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–13 lines × 2) · ×2
  • Duplicated block (7–13 lines × 2) app/src/main/java/com/example/llamadroid/harness/HarnessProjectIntegrationDialog.kt:139 — app/src/main/java/com/example/llamadroid/harness/HarnessProjectIntegrationDialog.kt:139-145 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:1287-1299 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/harness/HarnessProjectIntegrationDialog.kt:139` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–13 lines × 2) app/src/main/java/com/example/llamadroid/service/VideoInterpolationService.kt:172 — app/src/main/java/com/example/llamadroid/service/VideoInterpolationService.kt:172-178 | app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:202-214 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×2
  • Duplicated block (11 lines × 6) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:471 — app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:471-482 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:524-535 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:749-760 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:792-803 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:853-864 | app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:1462-1472 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:471` it begins part-way through the construct above it, so those exact lines 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 × 6) app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:75 — app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:75-85 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:106-116 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:137-147 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:159-173 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:723-733 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:770-780 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:75` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×2
  • Duplicated block (7–8 lines × 2) app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1063 — app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1063-1069 | app/src/main/java/com/example/llamadroid/service/PDFTranslationLogic.kt:372-379 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1063` 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–8 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4245 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4245-4251 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:396-403 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:396` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:404` calls `rememberLazyListState` and `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4252` 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:91 — app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:91-97 | app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:259-265 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1323-1329 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1441-1447 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:91` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 4) app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:92 — app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:92-98 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:133-139 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:279-285 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:315-321 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:92` 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.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×2
  • Duplicated block (5–6 lines × 2) app/src/main/java/com/example/llamadroid/harness/HarnessProviderCatalog.kt:103 — app/src/main/java/com/example/llamadroid/harness/HarnessProviderCatalog.kt:103-107 | app/src/main/java/com/example/llamadroid/harness/HarnessProviderCatalog.kt:204-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/harness/HarnessProviderCatalog.kt:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5–6 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:1030 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:1030-1035 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:3624-3628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:1030` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D5 · Coupling · Off the main sequence · ×2
  • Off the main sequence: :wear-protocol — :wear-protocol: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: :app — :app: abstractness 0.03, instability 0.06, distance 0.91 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
X1 · Async correctness · Blocking `Thread.sleep` inside a coroutine · ×2
  • Blocking `Thread.sleep` inside a coroutine app/src/main/java/com/example/llamadroid/service/SSHService.kt:388 — This coroutine runs on a dispatcher's thread, and `Thread.sleep` blocks that thread: for the whole delay no other coroutine scheduled on it makes progress (on `Dispatchers.Main` the UI freezes) — the Kotlin form of blocking on a task. Use `delay(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a call that cannot be made suspending, move it off the dispatcher with `withContext(Dispatchers.IO) { … }`.
  • Blocking `Thread.sleep` inside a coroutine app/src/main/java/com/example/llamadroid/service/SSHService.kt:809 — This coroutine runs on a dispatcher's thread, and `Thread.sleep` blocks that thread: for the whole delay no other coroutine scheduled on it makes progress (on `Dispatchers.Main` the UI freezes) — the Kotlin form of blocking on a task. Use `delay(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a call that cannot be made suspending, move it off the dispatcher with `withContext(Dispatchers.IO) { … }`.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark privacy-policy.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×1
  • Focus outline removed in CSS without a :focus replacement app/src/main/assets/file_station_webui/css/app.css:67 — `.main` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D1 · Cyclomatic Complexity · ImageGenScreenKt.ImageGenScreen (cyclomatic 475) · ×1
  • ImageGenScreenKt.ImageGenScreen (cyclomatic 475) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:140 — ImageGenScreenKt.ImageGenScreen has cyclomatic complexity 475 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentService.executeToolCall (cyclomatic 323) · ×1
  • AgentService.executeToolCall (cyclomatic 323) app/src/main/java/com/example/llamadroid/service/AgentService.kt:11014 — AgentService.executeToolCall has cyclomatic complexity 323 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentService.sendMessage (cyclomatic 317) · ×1
  • AgentService.sendMessage (cyclomatic 317) app/src/main/java/com/example/llamadroid/service/AgentService.kt:8199 — AgentService.sendMessage has cyclomatic complexity 317 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LlamaService.startServer (cyclomatic 257) · ×1
  • LlamaService.startServer (cyclomatic 257) app/src/main/java/com/example/llamadroid/service/LlamaService.kt:585 — LlamaService.startServer has cyclomatic complexity 257 (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.
D1 · Cyclomatic Complexity · MasterModeScreenKt.MasterModeScreen (cyclomatic 239) · ×1
  • MasterModeScreenKt.MasterModeScreen (cyclomatic 239) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:121 — MasterModeScreenKt.MasterModeScreen has cyclomatic complexity 239 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LlamaChatScreenKt.LlamaChatScreen (cyclomatic 155) · ×1
  • LlamaChatScreenKt.LlamaChatScreen (cyclomatic 155) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt:99 — LlamaChatScreenKt.LlamaChatScreen has cyclomatic complexity 155 (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.
D1 · Cyclomatic Complexity · NativeHarnessController.dispatchInternal (cyclomatic 150) · ×1
  • NativeHarnessController.dispatchInternal (cyclomatic 150) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:545 — NativeHarnessController.dispatchInternal has cyclomatic complexity 150 (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.
D1 · Cyclomatic Complexity · TamaScreenKt.TamaScreen (cyclomatic 137) · ×1
  • TamaScreenKt.TamaScreen (cyclomatic 137) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:149 — TamaScreenKt.TamaScreen has cyclomatic complexity 137 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MasterModeScreenKt.RemoteMasterCard (cyclomatic 132) · ×1
  • MasterModeScreenKt.RemoteMasterCard (cyclomatic 132) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3845 — MasterModeScreenKt.RemoteMasterCard has cyclomatic complexity 132 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentService.validateToolCall (cyclomatic 124) · ×1
  • AgentService.validateToolCall (cyclomatic 124) app/src/main/java/com/example/llamadroid/service/AgentService.kt:16676 — AgentService.validateToolCall has cyclomatic complexity 124 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentWorkspaceScreenKt.AgentWorkspaceScreen (cyclomatic 122) · ×1
  • AgentWorkspaceScreenKt.AgentWorkspaceScreen (cyclomatic 122) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:130 — AgentWorkspaceScreenKt.AgentWorkspaceScreen has cyclomatic complexity 122 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SdDistributedScreensKt.SdDistributedMasterScreen (cyclomatic 120) · ×1
  • SdDistributedScreensKt.SdDistributedMasterScreen (cyclomatic 120) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:616 — SdDistributedScreensKt.SdDistributedMasterScreen has cyclomatic complexity 120 (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.
D1 · Cyclomatic Complexity · HarnessAgentRouteKt.HarnessCapturedAgentRoute (cyclomatic 113) · ×1
  • HarnessAgentRouteKt.HarnessCapturedAgentRoute (cyclomatic 113) app/src/main/java/com/example/llamadroid/harness/HarnessAgentRoute.kt:148 — HarnessAgentRouteKt.HarnessCapturedAgentRoute has cyclomatic complexity 113 (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.
D1 · Cyclomatic Complexity · WorkflowsScreenKt.WorkflowsScreen (cyclomatic 112) · ×1
  • WorkflowsScreenKt.WorkflowsScreen (cyclomatic 112) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:98 — WorkflowsScreenKt.WorkflowsScreen has cyclomatic complexity 112 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentRuntimeProfileControlsKt.AgentRuntimeProfileControls (cyclomatic 108) · ×1
  • AgentRuntimeProfileControlsKt.AgentRuntimeProfileControls (cyclomatic 108) app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:103 — AgentRuntimeProfileControlsKt.AgentRuntimeProfileControls has cyclomatic complexity 108 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VideoGenScreenKt.VideoGenScreen (cyclomatic 104) · ×1
  • VideoGenScreenKt.VideoGenScreen (cyclomatic 104) app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:195 — VideoGenScreenKt.VideoGenScreen has cyclomatic complexity 104 (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.
D1 · Cyclomatic Complexity · NativeChatToolRuntime.executeToolCall (cyclomatic 96) · ×1
  • NativeChatToolRuntime.executeToolCall (cyclomatic 96) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:1507 — NativeChatToolRuntime.executeToolCall has cyclomatic complexity 96 (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.
D1 · Cyclomatic Complexity · HarnessScreenKt.NativeHarnessScreen (cyclomatic 93) · ×1
  • HarnessScreenKt.NativeHarnessScreen (cyclomatic 93) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:99 — HarnessScreenKt.NativeHarnessScreen has cyclomatic complexity 93 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SDModelsScreenKt.InstalledSDModelsTab (cyclomatic 91) · ×1
  • SDModelsScreenKt.InstalledSDModelsTab (cyclomatic 91) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:700 — SDModelsScreenKt.InstalledSDModelsTab has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LLMSettingsScreenKt.LlmSettingsContent (cyclomatic 88) · ×1
  • LLMSettingsScreenKt.LlmSettingsContent (cyclomatic 88) app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:92 — LLMSettingsScreenKt.LlmSettingsContent has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OnnxImageGenScreenKt.OnnxImageGenScreen (cyclomatic 86) · ×1
  • OnnxImageGenScreenKt.OnnxImageGenScreen (cyclomatic 86) app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:149 — OnnxImageGenScreenKt.OnnxImageGenScreen has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdventureGateScreenKt.AdventureGateBattleView (cyclomatic 79) · ×1
  • AdventureGateScreenKt.AdventureGateBattleView (cyclomatic 79) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:2657 — AdventureGateScreenKt.AdventureGateBattleView has cyclomatic complexity 79 (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.
D1 · Cyclomatic Complexity · RemoteServerFormKt.RemoteServerForm (cyclomatic 79) · ×1
  • RemoteServerFormKt.RemoteServerForm (cyclomatic 79) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/RemoteServerForm.kt:65 — RemoteServerFormKt.RemoteServerForm has cyclomatic complexity 79 (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.
D1 · Cyclomatic Complexity · DownloadService.startDownloadInternal (cyclomatic 76) · ×1
  • DownloadService.startDownloadInternal (cyclomatic 76) app/src/main/java/com/example/llamadroid/service/DownloadService.kt:565 — DownloadService.startDownloadInternal has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentDialogsKt.AgentSettingsDialog (cyclomatic 76) · ×1
  • AgentDialogsKt.AgentSettingsDialog (cyclomatic 76) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:848 — AgentDialogsKt.AgentSettingsDialog has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PDFToolboxScreenKt.PDFToolboxScreen (cyclomatic 76) · ×1
  • PDFToolboxScreenKt.PDFToolboxScreen (cyclomatic 76) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:67 — PDFToolboxScreenKt.PDFToolboxScreen has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SdArtifactInspector.classifyEvidence (cyclomatic 75) · ×1
  • SdArtifactInspector.classifyEvidence (cyclomatic 75) app/src/main/java/com/example/llamadroid/sd/SdArtifactInspector.kt:608 — SdArtifactInspector.classifyEvidence has cyclomatic complexity 75 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SdCliSupportKt.buildSdCommandArgs (cyclomatic 74) · ×1
  • SdCliSupportKt.buildSdCommandArgs (cyclomatic 74) app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt:193 — SdCliSupportKt.buildSdCommandArgs has cyclomatic complexity 74 (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.
D1 · Cyclomatic Complexity · ModelSourceRepository.runtimeModelTypeFor (cyclomatic 73) · ×1
  • ModelSourceRepository.runtimeModelTypeFor (cyclomatic 73) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:2426 — ModelSourceRepository.runtimeModelTypeFor has cyclomatic complexity 73 (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.
D1 · Cyclomatic Complexity · ArcadeScreenKt.ArcadeScreen (cyclomatic 73) · ×1
  • ArcadeScreenKt.ArcadeScreen (cyclomatic 73) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:159 — ArcadeScreenKt.ArcadeScreen has cyclomatic complexity 73 (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.
D1 · Cyclomatic Complexity · TamaCanonicalActions.request (cyclomatic 72) · ×1
  • TamaCanonicalActions.request (cyclomatic 72) app/src/main/java/com/example/llamadroid/tama/game/TamaCanonicalActions.kt:28 — TamaCanonicalActions.request has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VideoCommandBuilderKt.buildVideoCommandArgs (cyclomatic 70) · ×1
  • VideoCommandBuilderKt.buildVideoCommandArgs (cyclomatic 70) app/src/main/java/com/example/llamadroid/service/VideoCommandBuilder.kt:29 — VideoCommandBuilderKt.buildVideoCommandArgs has cyclomatic complexity 70 (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.
D1 · Cyclomatic Complexity · TermuxScreenKt.TermuxScreen (cyclomatic 70) · ×1
  • TermuxScreenKt.TermuxScreen (cyclomatic 70) app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:64 — TermuxScreenKt.TermuxScreen has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AudioTranscriptionScreenKt.AudioTranscriptionScreen (cyclomatic 69) · ×1
  • AudioTranscriptionScreenKt.AudioTranscriptionScreen (cyclomatic 69) app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:69 — AudioTranscriptionScreenKt.AudioTranscriptionScreen has cyclomatic complexity 69 (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.
D1 · Cyclomatic Complexity · LlamaServerChatService.performChatWithToolsStreaming (cyclomatic 66) · ×1
  • LlamaServerChatService.performChatWithToolsStreaming (cyclomatic 66) app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt:479 — LlamaServerChatService.performChatWithToolsStreaming has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AudioLibraryScreenKt.AudioLibraryScreen (cyclomatic 65) · ×1
  • AudioLibraryScreenKt.AudioLibraryScreen (cyclomatic 65) app/src/main/java/com/example/llamadroid/ui/audio/library/AudioLibraryScreen.kt:110 — AudioLibraryScreenKt.AudioLibraryScreen has cyclomatic complexity 65 (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.
D1 · Cyclomatic Complexity · HarnessInstallationsBindingKt.rememberHarnessInstallations (cyclomatic 64) · ×1
  • HarnessInstallationsBindingKt.rememberHarnessInstallations (cyclomatic 64) app/src/main/java/com/example/llamadroid/harness/HarnessInstallationsBinding.kt:29 — HarnessInstallationsBindingKt.rememberHarnessInstallations has cyclomatic complexity 64 (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.
D1 · Cyclomatic Complexity · HarnessRuntimeTransferKt.HarnessRuntimeTransferDialog (cyclomatic 64) · ×1
  • HarnessRuntimeTransferKt.HarnessRuntimeTransferDialog (cyclomatic 64) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeTransfer.kt:168 — HarnessRuntimeTransferKt.HarnessRuntimeTransferDialog has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app.renderChatControls (cyclomatic 63) · ×1
  • app.renderChatControls (cyclomatic 63) app/src/main/assets/ai_servers_webui/app.js:868 — app.renderChatControls has cyclomatic complexity 63 (threshold 15). Of this number, 56 points are the body's own statements and 7 belong to 3 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · AgentChatListKt.ChatMessageBubble (cyclomatic 62) · ×1
  • AgentChatListKt.ChatMessageBubble (cyclomatic 62) app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:863 — AgentChatListKt.ChatMessageBubble has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Downloader.download (cyclomatic 61) · ×1
  • Downloader.download (cyclomatic 61) app/src/main/java/com/example/llamadroid/util/Downloader.kt:38 — Downloader.download has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorkflowsScreenKt.Txt2ImgUpscaleWorkflowContent (cyclomatic 59) · ×1
  • WorkflowsScreenKt.Txt2ImgUpscaleWorkflowContent (cyclomatic 59) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5833 — WorkflowsScreenKt.Txt2ImgUpscaleWorkflowContent has cyclomatic complexity 59 (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.
D1 · Cyclomatic Complexity · BundleItemBuilderKt.buildBundleItems (cyclomatic 58) · ×1
  • BundleItemBuilderKt.buildBundleItems (cyclomatic 58) app/src/main/java/com/example/llamadroid/ui/models/BundleItemBuilder.kt:87 — BundleItemBuilderKt.buildBundleItems has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HarnessOriginalWebViewKt.HarnessOriginalWebView (cyclomatic 57) · ×1
  • HarnessOriginalWebViewKt.HarnessOriginalWebView (cyclomatic 57) app/src/main/java/com/example/llamadroid/harness/HarnessOriginalWebView.kt:417 — HarnessOriginalWebViewKt.HarnessOriginalWebView has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HarnessTerminalScreenUiKt.HarnessTerminalScreen (cyclomatic 57) · ×1
  • HarnessTerminalScreenUiKt.HarnessTerminalScreen (cyclomatic 57) app/src/main/java/com/example/llamadroid/harness/HarnessTerminalScreenUi.kt:149 — HarnessTerminalScreenUiKt.HarnessTerminalScreen has cyclomatic complexity 57 (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.
D1 · Cyclomatic Complexity · WorkflowsScreenKt.MangaTranslationWorkflowContent (cyclomatic 57) · ×1
  • WorkflowsScreenKt.MangaTranslationWorkflowContent (cyclomatic 57) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1497 — WorkflowsScreenKt.MangaTranslationWorkflowContent has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NotesManagerScreenKt.NotesManagerScreen (cyclomatic 57) · ×1
  • NotesManagerScreenKt.NotesManagerScreen (cyclomatic 57) app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:104 — NotesManagerScreenKt.NotesManagerScreen has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HarnessBridgeOperations.invoke (cyclomatic 56) · ×1
  • HarnessBridgeOperations.invoke (cyclomatic 56) app/src/main/java/com/example/llamadroid/harness/HarnessBridgeOperations.kt:104 — HarnessBridgeOperations.invoke has cyclomatic complexity 56 (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.
D1 · Cyclomatic Complexity · LlamaClientService.streamNativeToolResponse (cyclomatic 54) · ×1
  • LlamaClientService.streamNativeToolResponse (cyclomatic 54) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1908 — LlamaClientService.streamNativeToolResponse has cyclomatic complexity 54 (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.
D1 · Cyclomatic Complexity · NativeHarnessSettingsSchemaKt.normalizeHarnessSettingsSchema (cyclomatic 54) · ×1
  • NativeHarnessSettingsSchemaKt.normalizeHarnessSettingsSchema (cyclomatic 54) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessSettingsSchema.kt:22 — NativeHarnessSettingsSchemaKt.normalizeHarnessSettingsSchema has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VideoSumupScreenKt.VideoSumupScreen (cyclomatic 54) · ×1
  • VideoSumupScreenKt.VideoSumupScreen (cyclomatic 54) app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:72 — VideoSumupScreenKt.VideoSumupScreen has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LlamaService.onStartCommand (cyclomatic 52) · ×1
  • LlamaService.onStartCommand (cyclomatic 52) app/src/main/java/com/example/llamadroid/service/LlamaService.kt:311 — LlamaService.onStartCommand has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorldFarmMaintenance.complete (cyclomatic 52) · ×1
  • WorldFarmMaintenance.complete (cyclomatic 52) app/src/main/java/com/example/llamadroid/tama/game/WorldFarmMaintenance.kt:33 — WorldFarmMaintenance.complete has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MangaPaintedMaskEditorKt.PaintedMaskEditorContent (cyclomatic 52) · ×1
  • MangaPaintedMaskEditorKt.PaintedMaskEditorContent (cyclomatic 52) app/src/main/java/com/example/llamadroid/ui/ai/MangaPaintedMaskEditor.kt:223 — MangaPaintedMaskEditorKt.PaintedMaskEditorContent has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GeneralSettingsScreenKt.GeneralSettingsScreen (cyclomatic 52) · ×1
  • GeneralSettingsScreenKt.GeneralSettingsScreen (cyclomatic 52) app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:73 — GeneralSettingsScreenKt.GeneralSettingsScreen has cyclomatic complexity 52 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ToolHttpServer.routeApi (cyclomatic 51) · ×1
  • ToolHttpServer.routeApi (cyclomatic 51) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:348 — ToolHttpServer.routeApi has cyclomatic complexity 51 (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.
D1 · Cyclomatic Complexity · LlamaClientService.startGeneration (cyclomatic 51) · ×1
  • LlamaClientService.startGeneration (cyclomatic 51) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:412 — LlamaClientService.startGeneration has cyclomatic complexity 51 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ModelManagerScreenKt.InstalledTab (cyclomatic 51) · ×1
  • ModelManagerScreenKt.InstalledTab (cyclomatic 51) app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:223 — ModelManagerScreenKt.InstalledTab 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.
D1 · Cyclomatic Complexity · WearCompanionStore.sendRpc (cyclomatic 51) · ×1
  • WearCompanionStore.sendRpc (cyclomatic 51) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1090 — WearCompanionStore.sendRpc has cyclomatic complexity 51 (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.
D1 · Cyclomatic Complexity · UnifiedNotificationManager.showTaskNotification (cyclomatic 50) · ×1
  • UnifiedNotificationManager.showTaskNotification (cyclomatic 50) app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:677 — UnifiedNotificationManager.showTaskNotification has cyclomatic complexity 50 (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.
D1 · Cyclomatic Complexity · TermuxFileManagerScreenKt.TermuxFileManagerScreen (cyclomatic 50) · ×1
  • TermuxFileManagerScreenKt.TermuxFileManagerScreen (cyclomatic 50) app/src/main/java/com/example/llamadroid/ui/ai/TermuxFileManagerScreen.kt:98 — TermuxFileManagerScreenKt.TermuxFileManagerScreen has cyclomatic complexity 50 (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.
D1 · Cyclomatic Complexity · HarnessTermuxTransportViewKt.harnessTermuxKeySequence (cyclomatic 49) · ×1
  • HarnessTermuxTransportViewKt.harnessTermuxKeySequence (cyclomatic 49) app/src/main/java/com/example/llamadroid/harness/HarnessTermuxTransportView.kt:656 — HarnessTermuxTransportViewKt.harnessTermuxKeySequence has cyclomatic complexity 49 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · NativeChatVideoSupportKt.prepareNativeChatVideoPayloads (cyclomatic 49) · ×1
  • NativeChatVideoSupportKt.prepareNativeChatVideoPayloads (cyclomatic 49) app/src/main/java/com/example/llamadroid/service/chat/NativeChatVideoSupport.kt:74 — NativeChatVideoSupportKt.prepareNativeChatVideoPayloads has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentService.getAgentTools (cyclomatic 48) · ×1
  • AgentService.getAgentTools (cyclomatic 48) app/src/main/java/com/example/llamadroid/service/AgentService.kt:17281 — AgentService.getAgentTools has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RemoteMasterServer.handleClient (cyclomatic 48) · ×1
  • RemoteMasterServer.handleClient (cyclomatic 48) app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:116 — RemoteMasterServer.handleClient has cyclomatic complexity 48 (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.
D1 · Cyclomatic Complexity · AdventureGateScreenKt.AdventureGateScreen (cyclomatic 46) · ×1
  • AdventureGateScreenKt.AdventureGateScreen (cyclomatic 46) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:163 — AdventureGateScreenKt.AdventureGateScreen has cyclomatic complexity 46 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: AdventureGateScreenKt.formatLogEntry (cyclomatic 49) 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.
D1 · Cyclomatic Complexity · AgentDialogsKt.AgentGlobalOverrideCard (cyclomatic 46) · ×1
  • AgentDialogsKt.AgentGlobalOverrideCard (cyclomatic 46) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2695 — AgentDialogsKt.AgentGlobalOverrideCard has cyclomatic complexity 46 (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.
D1 · Cyclomatic Complexity · TamaNotificationReceiver.handleAlarm (cyclomatic 45) · ×1
  • TamaNotificationReceiver.handleAlarm (cyclomatic 45) app/src/main/java/com/example/llamadroid/tama/notifications/TamaNotificationReceiver.kt:50 — TamaNotificationReceiver.handleAlarm has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TamaChatScreenKt.TamaChatScreen (cyclomatic 45) · ×1
  • TamaChatScreenKt.TamaChatScreen (cyclomatic 45) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:90 — TamaChatScreenKt.TamaChatScreen has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VideoInterpolationScreenKt.VideoInterpolationScreen (cyclomatic 45) · ×1
  • VideoInterpolationScreenKt.VideoInterpolationScreen (cyclomatic 45) app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:119 — VideoInterpolationScreenKt.VideoInterpolationScreen has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LlamaAppKt.LlamaApp (cyclomatic 44) · ×1
  • LlamaAppKt.LlamaApp (cyclomatic 44) app/src/main/java/com/example/llamadroid/ui/LlamaApp.kt:192 — LlamaAppKt.LlamaApp has cyclomatic complexity 44 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · KiwixCatalogClient.parseOpdsXml (cyclomatic 43) · ×1
  • KiwixCatalogClient.parseOpdsXml (cyclomatic 43) app/src/main/java/com/example/llamadroid/data/model/KiwixCatalogClient.kt:85 — KiwixCatalogClient.parseOpdsXml has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TamaScreenKt.TamaPetDisplay (cyclomatic 43) · ×1
  • TamaScreenKt.TamaPetDisplay (cyclomatic 43) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4784 — TamaScreenKt.TamaPetDisplay has cyclomatic complexity 43 (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.
D1 · Cyclomatic Complexity · RemoteSummaryBackendEditorKt.RemoteSummaryBackendEditor (cyclomatic 43) · ×1
  • RemoteSummaryBackendEditorKt.RemoteSummaryBackendEditor (cyclomatic 43) app/src/main/java/com/example/llamadroid/ui/components/RemoteSummaryBackendEditor.kt:75 — RemoteSummaryBackendEditorKt.RemoteSummaryBackendEditor has cyclomatic complexity 43 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ModelRepository.getModelDir (cyclomatic 42) · ×1
  • ModelRepository.getModelDir (cyclomatic 42) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:261 — ModelRepository.getModelDir has cyclomatic complexity 42 (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.
D1 · Cyclomatic Complexity · VideoRecognitionSummaryService.run (cyclomatic 42) · ×1
  • VideoRecognitionSummaryService.run (cyclomatic 42) app/src/main/java/com/example/llamadroid/service/VideoRecognitionSummaryService.kt:666 — VideoRecognitionSummaryService.run has cyclomatic complexity 42 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LlamaChatListScreenKt.LlamaChatListContent (cyclomatic 42) · ×1
  • LlamaChatListScreenKt.LlamaChatListContent (cyclomatic 42) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatListScreen.kt:91 — LlamaChatListScreenKt.LlamaChatListContent has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MusicWorkspaceKt.MusicWorkspace (cyclomatic 42) · ×1
  • MusicWorkspaceKt.MusicWorkspace (cyclomatic 42) app/src/main/java/com/example/llamadroid/ui/audio/music/MusicWorkspace.kt:28 — MusicWorkspaceKt.MusicWorkspace has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PDFSummaryScreenKt.PDFSummaryScreen (cyclomatic 42) · ×1
  • PDFSummaryScreenKt.PDFSummaryScreen (cyclomatic 42) app/src/main/java/com/example/llamadroid/ui/pdf/PDFSummaryScreen.kt:74 — PDFSummaryScreenKt.PDFSummaryScreen has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BinaryRepository.findTieredBinary (cyclomatic 41) · ×1
  • BinaryRepository.findTieredBinary (cyclomatic 41) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:785 — BinaryRepository.findTieredBinary has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SdModelSupportKt.inferSdFamily (cyclomatic 41) · ×1
  • SdModelSupportKt.inferSdFamily (cyclomatic 41) app/src/main/java/com/example/llamadroid/sd/SdModelSupport.kt:523 — SdModelSupportKt.inferSdFamily has cyclomatic complexity 41 (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.
D1 · Cyclomatic Complexity · FarmDroneDataKt.runPlantingDroneTick (cyclomatic 41) · ×1
  • FarmDroneDataKt.runPlantingDroneTick (cyclomatic 41) app/src/main/java/com/example/llamadroid/tama/data/FarmDroneData.kt:265 — FarmDroneDataKt.runPlantingDroneTick has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FarmScreenKt.FarmScreen (cyclomatic 41) · ×1
  • FarmScreenKt.FarmScreen (cyclomatic 41) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmScreen.kt:78 — FarmScreenKt.FarmScreen has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChatMessageItemKt.LlamaMessageItem (cyclomatic 41) · ×1
  • ChatMessageItemKt.LlamaMessageItem (cyclomatic 41) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageItem.kt:110 — ChatMessageItemKt.LlamaMessageItem has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DatasetProjectScreenKt.ReviewTab (cyclomatic 41) · ×1
  • DatasetProjectScreenKt.ReviewTab (cyclomatic 41) app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:1323 — DatasetProjectScreenKt.ReviewTab has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PDFService.recognizeBitmapWithLlamaOcr (cyclomatic 40) · ×1
  • PDFService.recognizeBitmapWithLlamaOcr (cyclomatic 40) app/src/main/java/com/example/llamadroid/service/PDFService.kt:3461 — PDFService.recognizeBitmapWithLlamaOcr has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeHarnessSchemaKt.parseHarnessSchemaFields (cyclomatic 40) · ×1
  • NativeHarnessSchemaKt.parseHarnessSchemaFields (cyclomatic 40) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessSchema.kt:107 — NativeHarnessSchemaKt.parseHarnessSchemaFields has cyclomatic complexity 40 (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.
D1 · Cyclomatic Complexity · SDModelsScreenKt.inferSelectionType (cyclomatic 40) · ×1
  • SDModelsScreenKt.inferSelectionType (cyclomatic 40) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2431 — SDModelsScreenKt.inferSelectionType has cyclomatic complexity 40 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · EasyModelsScreenKt.EasyModelsScreen (cyclomatic 40) · ×1
  • EasyModelsScreenKt.EasyModelsScreen (cyclomatic 40) app/src/main/java/com/example/llamadroid/ui/easy/EasyModelsScreen.kt:114 — EasyModelsScreenKt.EasyModelsScreen has cyclomatic complexity 40 (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.
D1 · Cyclomatic Complexity · DistributedLlamaLaunchResolver.resolve (cyclomatic 39) · ×1
  • DistributedLlamaLaunchResolver.resolve (cyclomatic 39) app/src/main/java/com/example/llamadroid/service/DistributedLlamaLaunchProfile.kt:194 — DistributedLlamaLaunchResolver.resolve has cyclomatic complexity 39 (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.
D1 · Cyclomatic Complexity · ProcessController.start (cyclomatic 39) · ×1
  • ProcessController.start (cyclomatic 39) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:965 — ProcessController.start has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TamaChatScreenKt.TamaChatBubble (cyclomatic 39) · ×1
  • TamaChatScreenKt.TamaChatBubble (cyclomatic 39) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:773 — TamaChatScreenKt.TamaChatBubble has cyclomatic complexity 39 (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.
D1 · Cyclomatic Complexity · VideoUpscalerScreenKt.VideoUpscalerScreen (cyclomatic 39) · ×1
  • VideoUpscalerScreenKt.VideoUpscalerScreen (cyclomatic 39) app/src/main/java/com/example/llamadroid/ui/ai/VideoUpscalerScreen.kt:46 — VideoUpscalerScreenKt.VideoUpscalerScreen has cyclomatic complexity 39 (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.
D1 · Cyclomatic Complexity · MainActivityKt.localizedTamaLocationLabel (cyclomatic 39) · ×1
  • MainActivityKt.localizedTamaLocationLabel (cyclomatic 39) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:3165 — MainActivityKt.localizedTamaLocationLabel has cyclomatic complexity 39 (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.
D1 · Cyclomatic Complexity · ModelSourceRepository.startBundleDownloadQueue (cyclomatic 38) · ×1
  • ModelSourceRepository.startBundleDownloadQueue (cyclomatic 38) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1351 — ModelSourceRepository.startBundleDownloadQueue 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.
D1 · Cyclomatic Complexity · HarnessComposerKt.HarnessComposer (cyclomatic 37) · ×1
  • HarnessComposerKt.HarnessComposer (cyclomatic 37) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessComposer.kt:264 — HarnessComposerKt.HarnessComposer has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HarnessProjectActionDialogKt.HarnessProjectActionDialog (cyclomatic 37) · ×1
  • HarnessProjectActionDialogKt.HarnessProjectActionDialog (cyclomatic 37) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:81 — HarnessProjectActionDialogKt.HarnessProjectActionDialog has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NativeHarnessTurnDetailsKt.projectNativeHarnessTurnUsage (cyclomatic 37) · ×1
  • NativeHarnessTurnDetailsKt.projectNativeHarnessTurnUsage (cyclomatic 37) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetails.kt:601 — NativeHarnessTurnDetailsKt.projectNativeHarnessTurnUsage has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · selection.initSelection (cyclomatic 37) · ×1
  • selection.initSelection (cyclomatic 37) app/src/main/assets/file_station_webui/js/selection.js:153 — selection.initSelection has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 175, 155). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AudioGenerationService.localizeError (cyclomatic 36) · ×1
  • AudioGenerationService.localizeError (cyclomatic 36) app/src/main/java/com/example/llamadroid/audio/AudioGenerationService.kt:537 — AudioGenerationService.localizeError has cyclomatic complexity 36 (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.
D1 · Cyclomatic Complexity · ModelArtifactFinalizer.finalizePrepared (cyclomatic 36) · ×1
  • ModelArtifactFinalizer.finalizePrepared (cyclomatic 36) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactFinalizer.kt:228 — ModelArtifactFinalizer.finalizePrepared 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.
D1 · Cyclomatic Complexity · OllamaRepository.inspectModelfile (cyclomatic 36) · ×1
  • OllamaRepository.inspectModelfile (cyclomatic 36) app/src/main/java/com/example/llamadroid/data/repository/OllamaRepository.kt:218 — OllamaRepository.inspectModelfile has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentRuntimeDispatchResolver.resolve (cyclomatic 36) · ×1
  • AgentRuntimeDispatchResolver.resolve (cyclomatic 36) app/src/main/java/com/example/llamadroid/data/runtime/AgentRuntimeProfileSupport.kt:517 — AgentRuntimeDispatchResolver.resolve has cyclomatic complexity 36 (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.
D1 · Cyclomatic Complexity · SdModelSupportKt.inferSdVariant (cyclomatic 36) · ×1
  • SdModelSupportKt.inferSdVariant (cyclomatic 36) app/src/main/java/com/example/llamadroid/sd/SdModelSupport.kt:607 — SdModelSupportKt.inferSdVariant has cyclomatic complexity 36 (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.
D1 · Cyclomatic Complexity · AgentService.nextHintForTool (cyclomatic 36) · ×1
  • AgentService.nextHintForTool (cyclomatic 36) app/src/main/java/com/example/llamadroid/service/AgentService.kt:17230 — AgentService.nextHintForTool has cyclomatic complexity 36 (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.
D1 · Cyclomatic Complexity · AdventureGateCombatEngine.resolveSpeedRound (cyclomatic 36) · ×1
  • AdventureGateCombatEngine.resolveSpeedRound (cyclomatic 36) app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateCombatEngine.kt:349 — AdventureGateCombatEngine.resolveSpeedRound has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HarnessExtensionsPanelsKt.HarnessPluginsCard (cyclomatic 36) · ×1
  • HarnessExtensionsPanelsKt.HarnessPluginsCard (cyclomatic 36) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessExtensionsPanels.kt:201 — HarnessExtensionsPanelsKt.HarnessPluginsCard has cyclomatic complexity 36 (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.
D1 · Cyclomatic Complexity · QuadtrixCommandBuilder.trainingArgs (cyclomatic 35) · ×1
  • QuadtrixCommandBuilder.trainingArgs (cyclomatic 35) app/src/main/java/com/example/llamadroid/quadtrix/QuadtrixRuntime.kt:179 — QuadtrixCommandBuilder.trainingArgs 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.
D1 · Cyclomatic Complexity · ProcessController.getCommand (cyclomatic 35) · ×1
  • ProcessController.getCommand (cyclomatic 35) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:146 — ProcessController.getCommand has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · WhisperService.transcribe (cyclomatic 35) · ×1
  • WhisperService.transcribe (cyclomatic 35) app/src/main/java/com/example/llamadroid/service/WhisperService.kt:139 — WhisperService.transcribe has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NativeChatToolAwarenessMessagesKt.nativeChatToolAwarenessMessages (cyclomatic 35) · ×1
  • NativeChatToolAwarenessMessagesKt.nativeChatToolAwarenessMessages (cyclomatic 35) app/src/main/java/com/example/llamadroid/service/chat/NativeChatToolAwarenessMessages.kt:10 — NativeChatToolAwarenessMessagesKt.nativeChatToolAwarenessMessages 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.
D1 · Cyclomatic Complexity · AdventureScreenKt.AdventureScreen (cyclomatic 35) · ×1
  • AdventureScreenKt.AdventureScreen (cyclomatic 35) app/src/main/java/com/example/llamadroid/tama/ui/AdventureScreen.kt:95 — AdventureScreenKt.AdventureScreen 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.
D1 · Cyclomatic Complexity · AgentRuntimeSupport.resolveFinishTaskPayload (cyclomatic 34) · ×1
  • AgentRuntimeSupport.resolveFinishTaskPayload (cyclomatic 34) app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:1954 — AgentRuntimeSupport.resolveFinishTaskPayload 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.
D1 · Cyclomatic Complexity · LlamaClientService.streamLlamaServerResponse (cyclomatic 34) · ×1
  • LlamaClientService.streamLlamaServerResponse (cyclomatic 34) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1344 — LlamaClientService.streamLlamaServerResponse 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.
D1 · Cyclomatic Complexity · AgentWorkspaceScreenKt.WorkspaceTerminalDialog (cyclomatic 34) · ×1
  • AgentWorkspaceScreenKt.WorkspaceTerminalDialog (cyclomatic 34) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1780 — AgentWorkspaceScreenKt.WorkspaceTerminalDialog has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AudioWorkspaceScreenKt.AudioWorkspaceScreen (cyclomatic 34) · ×1
  • AudioWorkspaceScreenKt.AudioWorkspaceScreen (cyclomatic 34) app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceScreen.kt:122 — AudioWorkspaceScreenKt.AudioWorkspaceScreen has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentProjectControlPlane.permittedNextActions (cyclomatic 33) · ×1
  • AgentProjectControlPlane.permittedNextActions (cyclomatic 33) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:3209 — AgentProjectControlPlane.permittedNextActions 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.
D1 · Cyclomatic Complexity · NativeHarnessController.selectModel (cyclomatic 33) · ×1
  • NativeHarnessController.selectModel (cyclomatic 33) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1406 — NativeHarnessController.selectModel 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.
D1 · Cyclomatic Complexity · NativeHarnessProjectReviewModelsKt.foldNativeHarnessWorkflows (cyclomatic 33) · ×1
  • NativeHarnessProjectReviewModelsKt.foldNativeHarnessWorkflows (cyclomatic 33) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProjectReviewModels.kt:467 — NativeHarnessProjectReviewModelsKt.foldNativeHarnessWorkflows 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.
D1 · Cyclomatic Complexity · WorkflowsScreenKt.TranscribeSummaryWorkflowContent (cyclomatic 33) · ×1
  • WorkflowsScreenKt.TranscribeSummaryWorkflowContent (cyclomatic 33) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6884 — WorkflowsScreenKt.TranscribeSummaryWorkflowContent 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.
D1 · Cyclomatic Complexity · ServerProfileEditorScreenKt.ServerProfileEditorScreen (cyclomatic 33) · ×1
  • ServerProfileEditorScreenKt.ServerProfileEditorScreen (cyclomatic 33) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/ServerProfileEditorScreen.kt:93 — ServerProfileEditorScreenKt.ServerProfileEditorScreen 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.
D1 · Cyclomatic Complexity · SdWorkflowGateKt.evaluateSdWorkflowGate (cyclomatic 32) · ×1
  • SdWorkflowGateKt.evaluateSdWorkflowGate (cyclomatic 32) app/src/main/java/com/example/llamadroid/data/model/SdWorkflowGate.kt:63 — SdWorkflowGateKt.evaluateSdWorkflowGate 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.
D1 · Cyclomatic Complexity · AgentDirectRuntimeSupportKt.advanceDirectAgentState (cyclomatic 32) · ×1
  • AgentDirectRuntimeSupportKt.advanceDirectAgentState (cyclomatic 32) app/src/main/java/com/example/llamadroid/service/AgentDirectRuntimeSupport.kt:42 — AgentDirectRuntimeSupportKt.advanceDirectAgentState has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentProjectControlPlane.applyDirectToolReceipt (cyclomatic 32) · ×1
  • AgentProjectControlPlane.applyDirectToolReceipt (cyclomatic 32) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:920 — AgentProjectControlPlane.applyDirectToolReceipt has cyclomatic complexity 32 (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.
D1 · Cyclomatic Complexity · CustomToolHttpExecutor.prepare (cyclomatic 32) · ×1
  • CustomToolHttpExecutor.prepare (cyclomatic 32) app/src/main/java/com/example/llamadroid/service/CustomToolHttpExecutor.kt:47 — CustomToolHttpExecutor.prepare has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · QuadtrixTrainingService.runProcess (cyclomatic 32) · ×1
  • QuadtrixTrainingService.runProcess (cyclomatic 32) app/src/main/java/com/example/llamadroid/service/QuadtrixTrainingService.kt:302 — QuadtrixTrainingService.runProcess has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TamaScreenKt.TamaControls (cyclomatic 32) · ×1
  • TamaScreenKt.TamaControls (cyclomatic 32) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5293 — TamaScreenKt.TamaControls has cyclomatic complexity 32 (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.
D1 · Cyclomatic Complexity · OnnxBackgroundRemovalScreenKt.OnnxBackgroundRemovalScreen (cyclomatic 32) · ×1
  • OnnxBackgroundRemovalScreenKt.OnnxBackgroundRemovalScreen (cyclomatic 32) app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:127 — OnnxBackgroundRemovalScreenKt.OnnxBackgroundRemovalScreen has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LlamaSchedulerScreenKt.LlamaScheduledTaskEditorDialog (cyclomatic 32) · ×1
  • LlamaSchedulerScreenKt.LlamaScheduledTaskEditorDialog (cyclomatic 32) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:652 — LlamaSchedulerScreenKt.LlamaScheduledTaskEditorDialog has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiteRtModelsScreenKt.LiteRtModelsScreen (cyclomatic 32) · ×1
  • LiteRtModelsScreenKt.LiteRtModelsScreen (cyclomatic 32) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:160 — LiteRtModelsScreenKt.LiteRtModelsScreen 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.
D1 · Cyclomatic Complexity · ModelRepository.deleteModelArtifactsInternal (cyclomatic 31) · ×1
  • ModelRepository.deleteModelArtifactsInternal (cyclomatic 31) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1060 — ModelRepository.deleteModelArtifactsInternal 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.
D1 · Cyclomatic Complexity · AgentControlPromptSupportKt.evidenceRecordsFromContent (cyclomatic 31) · ×1
  • AgentControlPromptSupportKt.evidenceRecordsFromContent (cyclomatic 31) app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:407 — AgentControlPromptSupportKt.evidenceRecordsFromContent 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.
D1 · Cyclomatic Complexity · HarnessInlineLinksKt.harnessInlineLinks (cyclomatic 31) · ×1
  • HarnessInlineLinksKt.harnessInlineLinks (cyclomatic 31) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessInlineLinks.kt:64 — HarnessInlineLinksKt.harnessInlineLinks 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.
D1 · Cyclomatic Complexity · NativeHarnessPluginActions.install (cyclomatic 31) · ×1
  • NativeHarnessPluginActions.install (cyclomatic 31) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessPluginActions.kt:71 — NativeHarnessPluginActions.install 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.
D1 · Cyclomatic Complexity · NativeHarnessTurnActions.copyAssistantTurn (cyclomatic 31) · ×1
  • NativeHarnessTurnActions.copyAssistantTurn (cyclomatic 31) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnActions.kt:216 — NativeHarnessTurnActions.copyAssistantTurn 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.
D1 · Cyclomatic Complexity · FastsdGalleryScreenKt.FastsdGalleryScreen (cyclomatic 31) · ×1
  • FastsdGalleryScreenKt.FastsdGalleryScreen (cyclomatic 31) app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:74 — FastsdGalleryScreenKt.FastsdGalleryScreen 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.
D1 · Cyclomatic Complexity · LegacyUpscaleScreenKt.LegacyUpscaleScreen (cyclomatic 31) · ×1
  • LegacyUpscaleScreenKt.LegacyUpscaleScreen (cyclomatic 31) app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:113 — LegacyUpscaleScreenKt.LegacyUpscaleScreen 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.
D1 · Cyclomatic Complexity · DatasetProjectScreenKt.SettingsTab (cyclomatic 31) · ×1
  • DatasetProjectScreenKt.SettingsTab (cyclomatic 31) app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:1873 — DatasetProjectScreenKt.SettingsTab 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.
D1 · Cyclomatic Complexity · EasyImagesTabKt.EasyImagesTab (cyclomatic 31) · ×1
  • EasyImagesTabKt.EasyImagesTab (cyclomatic 31) app/src/main/java/com/example/llamadroid/ui/easy/EasyImagesTab.kt:98 — EasyImagesTabKt.EasyImagesTab has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ToolHttpServer.generateWebChatReply (cyclomatic 30) · ×1
  • ToolHttpServer.generateWebChatReply (cyclomatic 30) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:3075 — ToolHttpServer.generateWebChatReply has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassicFarmPlots.apply (cyclomatic 30) · ×1
  • ClassicFarmPlots.apply (cyclomatic 30) app/src/main/java/com/example/llamadroid/tama/game/ClassicFarmPlots.kt:70 — ClassicFarmPlots.apply has cyclomatic complexity 30 (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.
D1 · Cyclomatic Complexity · LiteRtModelRepository.packagePreferenceRank (cyclomatic 29) · ×1
  • LiteRtModelRepository.packagePreferenceRank (cyclomatic 29) app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:1158 — LiteRtModelRepository.packagePreferenceRank has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · HarnessAppToolsSettingsKt.HarnessAppToolsSettingsDialog (cyclomatic 29) · ×1
  • HarnessAppToolsSettingsKt.HarnessAppToolsSettingsDialog (cyclomatic 29) app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:54 — HarnessAppToolsSettingsKt.HarnessAppToolsSettingsDialog has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SdArtifactInspector.detectVideoFamily (cyclomatic 29) · ×1
  • SdArtifactInspector.detectVideoFamily (cyclomatic 29) app/src/main/java/com/example/llamadroid/sd/SdArtifactInspector.kt:805 — SdArtifactInspector.detectVideoFamily has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · NativeChatToolRuntime.availableTools (cyclomatic 29) · ×1
  • NativeChatToolRuntime.availableTools (cyclomatic 29) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:970 — NativeChatToolRuntime.availableTools has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SubtitleBurnScreenKt.SubtitleBurnScreen (cyclomatic 29) · ×1
  • SubtitleBurnScreenKt.SubtitleBurnScreen (cyclomatic 29) app/src/main/java/com/example/llamadroid/ui/ai/SubtitleBurnScreen.kt:71 — SubtitleBurnScreenKt.SubtitleBurnScreen has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OllamaManagerScreenKt.OllamaManagerScreen (cyclomatic 29) · ×1
  • OllamaManagerScreenKt.OllamaManagerScreen (cyclomatic 29) app/src/main/java/com/example/llamadroid/ui/ai/ollama/OllamaManagerScreen.kt:62 — OllamaManagerScreenKt.OllamaManagerScreen has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PDFToolboxScreenKt.GuidedPdfOcrTool (cyclomatic 29) · ×1
  • PDFToolboxScreenKt.GuidedPdfOcrTool (cyclomatic 29) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1493 — PDFToolboxScreenKt.GuidedPdfOcrTool has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MainActivityKt.locationBackgroundAssetPath (cyclomatic 29) · ×1
  • MainActivityKt.locationBackgroundAssetPath (cyclomatic 29) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:3201 — MainActivityKt.locationBackgroundAssetPath has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AgentRuntimeSupportKt.sanitizeTerminalTranscript (cyclomatic 28) · ×1
  • AgentRuntimeSupportKt.sanitizeTerminalTranscript (cyclomatic 28) app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:915 — AgentRuntimeSupportKt.sanitizeTerminalTranscript 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.
D1 · Cyclomatic Complexity · AgentService.runReflectionTool (cyclomatic 28) · ×1
  • AgentService.runReflectionTool (cyclomatic 28) app/src/main/java/com/example/llamadroid/service/AgentService.kt:15323 — AgentService.runReflectionTool has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: AgentService.toolExampleJson (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · HarnessSettingsNavigationKt.HarnessSettingsNavigator (cyclomatic 28) · ×1
  • HarnessSettingsNavigationKt.HarnessSettingsNavigator (cyclomatic 28) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessSettingsNavigation.kt:133 — HarnessSettingsNavigationKt.HarnessSettingsNavigator 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.
D1 · Cyclomatic Complexity · ModelLibraryScreenKt.BundleEditorDialog (cyclomatic 28) · ×1
  • ModelLibraryScreenKt.BundleEditorDialog (cyclomatic 28) app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryScreen.kt:1393 — ModelLibraryScreenKt.BundleEditorDialog 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. This is NOT this file's highest cyclomatic complexity: ModelLibraryScreenKt.modelLibraryErrorResource (cyclomatic 43) 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.
D1 · Cyclomatic Complexity · ModelRepository.updateModel (cyclomatic 27) · ×1
  • ModelRepository.updateModel (cyclomatic 27) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1398 — ModelRepository.updateModel 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.
D1 · Cyclomatic Complexity · HarnessRuntimeController.runStart (cyclomatic 27) · ×1
  • HarnessRuntimeController.runStart (cyclomatic 27) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:375 — HarnessRuntimeController.runStart 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.
D1 · Cyclomatic Complexity · HarnessRuntimeProcessKt.classifyHarnessProcessOutput (cyclomatic 27) · ×1
  • HarnessRuntimeProcessKt.classifyHarnessProcessOutput (cyclomatic 27) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeProcess.kt:254 — HarnessRuntimeProcessKt.classifyHarnessProcessOutput has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · HarnessTransferCodec.stage (cyclomatic 27) · ×1
  • HarnessTransferCodec.stage (cyclomatic 27) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:243 — HarnessTransferCodec.stage has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentControlPromptSupportKt.preserveToolControlContent (cyclomatic 27) · ×1
  • AgentControlPromptSupportKt.preserveToolControlContent (cyclomatic 27) app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:828 — AgentControlPromptSupportKt.preserveToolControlContent has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VideoSumupService.summarizeVideo (cyclomatic 27) · ×1
  • VideoSumupService.summarizeVideo (cyclomatic 27) app/src/main/java/com/example/llamadroid/service/VideoSumupService.kt:196 — VideoSumupService.summarizeVideo 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.
D1 · Cyclomatic Complexity · HarnessProjectActionDialogKt.HarnessProjectBatchRemovalDialog (cyclomatic 27) · ×1
  • HarnessProjectActionDialogKt.HarnessProjectBatchRemovalDialog (cyclomatic 27) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:343 — HarnessProjectActionDialogKt.HarnessProjectBatchRemovalDialog has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LiveTranslatorScreenKt.LiveTranslatorScreen (cyclomatic 27) · ×1
  • LiveTranslatorScreenKt.LiveTranslatorScreen (cyclomatic 27) app/src/main/java/com/example/llamadroid/ui/ai/LiveTranslatorScreen.kt:130 — LiveTranslatorScreenKt.LiveTranslatorScreen has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChatScreenSupportKt.mimeTypeToExtension (cyclomatic 27) · ×1
  • ChatScreenSupportKt.mimeTypeToExtension (cyclomatic 27) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatScreenSupport.kt:193 — ChatScreenSupportKt.mimeTypeToExtension has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · CuratedModelBundlePickerKt.CuratedModelBundlePicker (cyclomatic 27) · ×1
  • CuratedModelBundlePickerKt.CuratedModelBundlePicker (cyclomatic 27) app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundlePicker.kt:111 — CuratedModelBundlePickerKt.CuratedModelBundlePicker has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ZimManagerScreenKt.InstalledZimsTab (cyclomatic 27) · ×1
  • ZimManagerScreenKt.InstalledZimsTab (cyclomatic 27) app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:182 — ZimManagerScreenKt.InstalledZimsTab has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · KnowledgeBaseScreenKt.KnowledgeBaseScreen (cyclomatic 27) · ×1
  • KnowledgeBaseScreenKt.KnowledgeBaseScreen (cyclomatic 27) app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:122 — KnowledgeBaseScreenKt.KnowledgeBaseScreen 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.
D1 · Cyclomatic Complexity · ExternalRouteResolver.resolve (cyclomatic 27) · ×1
  • ExternalRouteResolver.resolve (cyclomatic 27) app/src/main/java/com/example/llamadroid/ui/navigation/ExternalRouteResolver.kt:133 — ExternalRouteResolver.resolve has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · WalkthroughUiKt.WalkthroughCoach (cyclomatic 27) · ×1
  • WalkthroughUiKt.WalkthroughCoach (cyclomatic 27) app/src/main/java/com/example/llamadroid/ui/walkthrough/WalkthroughUi.kt:90 — WalkthroughUiKt.WalkthroughCoach has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · app.wireChatControls (cyclomatic 27) · ×1
  • app.wireChatControls (cyclomatic 27) app/src/main/assets/ai_servers_webui/app.js:1226 — app.wireChatControls has cyclomatic complexity 27 (threshold 15). Of this number, 20 points are the body's own statements and 7 belong to 5 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · ModelArtifactRecognizer.inspect (cyclomatic 26) · ×1
  • ModelArtifactRecognizer.inspect (cyclomatic 26) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:48 — ModelArtifactRecognizer.inspect has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ModelArtifactRecognizer.artifactRoleForManualSelection (cyclomatic 34) 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.
D1 · Cyclomatic Complexity · HarnessPresetFilesDialogKt.HarnessPresetFilesDialog (cyclomatic 26) · ×1
  • HarnessPresetFilesDialogKt.HarnessPresetFilesDialog (cyclomatic 26) app/src/main/java/com/example/llamadroid/harness/HarnessPresetFilesDialog.kt:53 — HarnessPresetFilesDialogKt.HarnessPresetFilesDialog 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.
D1 · Cyclomatic Complexity · SdModelSupportKt.resolveSdFamilySpec (cyclomatic 26) · ×1
  • SdModelSupportKt.resolveSdFamilySpec (cyclomatic 26) app/src/main/java/com/example/llamadroid/sd/SdModelSupport.kt:681 — SdModelSupportKt.resolveSdFamilySpec has cyclomatic complexity 26 (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.
D1 · Cyclomatic Complexity · SdPipelineResolver.resolve (cyclomatic 26) · ×1
  • SdPipelineResolver.resolve (cyclomatic 26) app/src/main/java/com/example/llamadroid/sd/SdPipelineResolver.kt:118 — SdPipelineResolver.resolve 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.
D1 · Cyclomatic Complexity · ManagedLlamaServerCoordinator.prepare (cyclomatic 26) · ×1
  • ManagedLlamaServerCoordinator.prepare (cyclomatic 26) app/src/main/java/com/example/llamadroid/service/ManagedLlamaServerCoordinator.kt:96 — ManagedLlamaServerCoordinator.prepare has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MangaTranslationSupport.preflight (cyclomatic 26) · ×1
  • MangaTranslationSupport.preflight (cyclomatic 26) app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:756 — MangaTranslationSupport.preflight has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeChatToolConfig.effectiveWithServerDefaults (cyclomatic 26) · ×1
  • NativeChatToolConfig.effectiveWithServerDefaults (cyclomatic 26) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:320 — NativeChatToolConfig.effectiveWithServerDefaults has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · TamaDailyDreamManager.queueDreamIfEligible (cyclomatic 26) · ×1
  • TamaDailyDreamManager.queueDreamIfEligible (cyclomatic 26) app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:129 — TamaDailyDreamManager.queueDreamIfEligible 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.
D1 · Cyclomatic Complexity · AdventureGateScreenKt.SkillLoadoutTreeRow (cyclomatic 26) · ×1
  • AdventureGateScreenKt.SkillLoadoutTreeRow (cyclomatic 26) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:2407 — AdventureGateScreenKt.SkillLoadoutTreeRow has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: AdventureGateScreenKt.formatLogEntry (cyclomatic 49) 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.
D1 · Cyclomatic Complexity · AdventureGateScreenKt.gearInfoText (cyclomatic 26) · ×1
  • AdventureGateScreenKt.gearInfoText (cyclomatic 26) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4551 — AdventureGateScreenKt.gearInfoText 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. This is NOT this file's highest cyclomatic complexity: AdventureGateScreenKt.formatLogEntry (cyclomatic 49) 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.
D1 · Cyclomatic Complexity · HarnessModelEditorKt.HarnessEditableModelRow (cyclomatic 26) · ×1
  • HarnessModelEditorKt.HarnessEditableModelRow (cyclomatic 26) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessModelEditor.kt:278 — HarnessModelEditorKt.HarnessEditableModelRow 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.
D1 · Cyclomatic Complexity · HarnessScreenKt.HarnessTranscriptCard (cyclomatic 26) · ×1
  • HarnessScreenKt.HarnessTranscriptCard (cyclomatic 26) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:649 — HarnessScreenKt.HarnessTranscriptCard 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.
D1 · Cyclomatic Complexity · NativeHarnessStructuredTranscriptKt.reprojectNativeHarnessLiveSkillBatch (cyclomatic 26) · ×1
  • NativeHarnessStructuredTranscriptKt.reprojectNativeHarnessLiveSkillBatch (cyclomatic 26) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessStructuredTranscript.kt:369 — NativeHarnessStructuredTranscriptKt.reprojectNativeHarnessLiveSkillBatch has cyclomatic complexity 26 (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.
D1 · Cyclomatic Complexity · NativeHarnessTurnDetailsKt.mergeNativeHarnessTurnDetails (cyclomatic 26) · ×1
  • NativeHarnessTurnDetailsKt.mergeNativeHarnessTurnDetails (cyclomatic 26) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetails.kt:218 — NativeHarnessTurnDetailsKt.mergeNativeHarnessTurnDetails has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImageGenModeSupportKt.resolveImageGenReadiness (cyclomatic 26) · ×1
  • ImageGenModeSupportKt.resolveImageGenReadiness (cyclomatic 26) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenModeSupport.kt:79 — ImageGenModeSupportKt.resolveImageGenReadiness has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PrepareCachesSheetKt.PrepareCachesSheet (cyclomatic 26) · ×1
  • PrepareCachesSheetKt.PrepareCachesSheet (cyclomatic 26) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:67 — PrepareCachesSheetKt.PrepareCachesSheet 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.
D1 · Cyclomatic Complexity · FullHfRepositoryBrowserKt.FullHfRepositoryBrowser (cyclomatic 26) · ×1
  • FullHfRepositoryBrowserKt.FullHfRepositoryBrowser (cyclomatic 26) app/src/main/java/com/example/llamadroid/ui/models/FullHfRepositoryBrowser.kt:63 — FullHfRepositoryBrowserKt.FullHfRepositoryBrowser 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.
D1 · Cyclomatic Complexity · OnnxModelsScreenKt.OnnxModelsScreen (cyclomatic 26) · ×1
  • OnnxModelsScreenKt.OnnxModelsScreen (cyclomatic 26) app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:154 — OnnxModelsScreenKt.OnnxModelsScreen 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.
D1 · Cyclomatic Complexity · BenchmarkScreenKt.BenchmarkScreen (cyclomatic 26) · ×1
  • BenchmarkScreenKt.BenchmarkScreen (cyclomatic 26) app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkScreen.kt:42 — BenchmarkScreenKt.BenchmarkScreen 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.
D1 · Cyclomatic Complexity · HarnessInstallationTransfer.export (cyclomatic 25) · ×1
  • HarnessInstallationTransfer.export (cyclomatic 25) app/src/main/java/com/example/llamadroid/harness/HarnessInstallationTransfer.kt:111 — HarnessInstallationTransfer.export has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HarnessRuntimePresentationKt.runtimePresentation (cyclomatic 25) · ×1
  • HarnessRuntimePresentationKt.runtimePresentation (cyclomatic 25) app/src/main/java/com/example/llamadroid/harness/HarnessRuntimePresentation.kt:28 — HarnessRuntimePresentationKt.runtimePresentation has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: HarnessRuntimePresentationKt.runtimeFailureText (cyclomatic 39) 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.
D1 · Cyclomatic Complexity · HarnessTransferCodec.scanTree (cyclomatic 25) · ×1
  • HarnessTransferCodec.scanTree (cyclomatic 25) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:506 — HarnessTransferCodec.scanTree has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentService.approvePendingPlan (cyclomatic 25) · ×1
  • AgentService.approvePendingPlan (cyclomatic 25) app/src/main/java/com/example/llamadroid/service/AgentService.kt:7093 — AgentService.approvePendingPlan has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: AgentService.toolExampleJson (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ToolHttpServer.requestNativeCancellation (cyclomatic 25) · ×1
  • ToolHttpServer.requestNativeCancellation (cyclomatic 25) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:655 — ToolHttpServer.requestNativeCancellation has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SSHService.uploadToRemotePath (cyclomatic 25) · ×1
  • SSHService.uploadToRemotePath (cyclomatic 25) app/src/main/java/com/example/llamadroid/service/SSHService.kt:447 — SSHService.uploadToRemotePath has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SubtitleBurnService.burnSubtitles (cyclomatic 25) · ×1
  • SubtitleBurnService.burnSubtitles (cyclomatic 25) app/src/main/java/com/example/llamadroid/service/SubtitleBurnService.kt:168 — SubtitleBurnService.burnSubtitles has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HarnessTaskDigest.foldEvent (cyclomatic 25) · ×1
  • HarnessTaskDigest.foldEvent (cyclomatic 25) app/src/main/java/com/example/llamadroid/service/delegation/HarnessTaskDigest.kt:174 — HarnessTaskDigest.foldEvent has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GgufModelShapeReader.read (cyclomatic 25) · ×1
  • GgufModelShapeReader.read (cyclomatic 25) app/src/main/java/com/example/llamadroid/service/ram/GgufModelShapeReader.kt:25 — GgufModelShapeReader.read has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TamaCanonicalActions.complete (cyclomatic 25) · ×1
  • TamaCanonicalActions.complete (cyclomatic 25) app/src/main/java/com/example/llamadroid/tama/game/TamaCanonicalActions.kt:133 — TamaCanonicalActions.complete has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AdventureGateCombatEngine.applyEnemyAction (cyclomatic 25) · ×1
  • AdventureGateCombatEngine.applyEnemyAction (cyclomatic 25) app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateCombatEngine.kt:1060 — AdventureGateCombatEngine.applyEnemyAction has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TamaScreenKt.TamaParkEncounterDialog (cyclomatic 25) · ×1
  • TamaScreenKt.TamaParkEncounterDialog (cyclomatic 25) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:1316 — TamaScreenKt.TamaParkEncounterDialog has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HarnessRootfsFileBrowserKt.HarnessRootfsFileBrowser (cyclomatic 25) · ×1
  • HarnessRootfsFileBrowserKt.HarnessRootfsFileBrowser (cyclomatic 25) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRootfsFileBrowser.kt:70 — HarnessRootfsFileBrowserKt.HarnessRootfsFileBrowser has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · HarnessScreenKt.HarnessProviderCard (cyclomatic 25) · ×1
  • HarnessScreenKt.HarnessProviderCard (cyclomatic 25) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1419 — HarnessScreenKt.HarnessProviderCard has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChatSettingsSectionsKt.ImageToolsSection (cyclomatic 25) · ×1
  • ChatSettingsSectionsKt.ImageToolsSection (cyclomatic 25) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsSections.kt:578 — ChatSettingsSectionsKt.ImageToolsSection has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ZimManagerScreenKt.ZimShareTab (cyclomatic 25) · ×1
  • ZimManagerScreenKt.ZimShareTab (cyclomatic 25) app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:1079 — ZimManagerScreenKt.ZimShareTab has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · KnowledgeBaseScreenKt.KnowledgeEmbeddingServerCard (cyclomatic 25) · ×1
  • KnowledgeBaseScreenKt.KnowledgeEmbeddingServerCard (cyclomatic 25) app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:646 — KnowledgeBaseScreenKt.KnowledgeEmbeddingServerCard has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HarnessTransferPublication.prepareAndPublish (cyclomatic 24) · ×1
  • HarnessTransferPublication.prepareAndPublish (cyclomatic 24) app/src/main/java/com/example/llamadroid/harness/HarnessTransferPublication.kt:60 — HarnessTransferPublication.prepareAndPublish has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StableDiffusionService.runGenerationWithBinary (cyclomatic 24) · ×1
  • StableDiffusionService.runGenerationWithBinary (cyclomatic 24) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:797 — StableDiffusionService.runGenerationWithBinary has cyclomatic complexity 24 (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.
D1 · Cyclomatic Complexity · VideoGenerationService.runGeneration (cyclomatic 24) · ×1
  • VideoGenerationService.runGeneration (cyclomatic 24) app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:359 — VideoGenerationService.runGeneration has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TamaGameEngine.restoreTransferBundle (cyclomatic 24) · ×1
  • TamaGameEngine.restoreTransferBundle (cyclomatic 24) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:3523 — TamaGameEngine.restoreTransferBundle has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NativeHarnessSettingsReader.readModelCatalog (cyclomatic 24) · ×1
  • NativeHarnessSettingsReader.readModelCatalog (cyclomatic 24) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessSettingsReader.kt:188 — NativeHarnessSettingsReader.readModelCatalog 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.
D1 · Cyclomatic Complexity · SdIpAdapterControlsKt.SdIpAdapterCard (cyclomatic 24) · ×1
  • SdIpAdapterControlsKt.SdIpAdapterCard (cyclomatic 24) app/src/main/java/com/example/llamadroid/ui/ai/SdIpAdapterControls.kt:70 — SdIpAdapterControlsKt.SdIpAdapterCard has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · WorkflowsScreenKt.SubtitleTranslationWorkflowContent (cyclomatic 24) · ×1
  • WorkflowsScreenKt.SubtitleTranslationWorkflowContent (cyclomatic 24) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4017 — WorkflowsScreenKt.SubtitleTranslationWorkflowContent has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · WorkerModeScreenKt.WorkerModeScreen (cyclomatic 24) · ×1
  • WorkerModeScreenKt.WorkerModeScreen (cyclomatic 24) app/src/main/java/com/example/llamadroid/ui/distributed/WorkerModeScreen.kt:75 — WorkerModeScreenKt.WorkerModeScreen 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.
D1 · Cyclomatic Complexity · LogsScreenKt.LogsScreen (cyclomatic 24) · ×1
  • LogsScreenKt.LogsScreen (cyclomatic 24) app/src/main/java/com/example/llamadroid/ui/logs/LogsScreen.kt:53 — LogsScreenKt.LogsScreen has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · upload.run (cyclomatic 24) · ×1
  • upload.run (cyclomatic 24) app/src/main/assets/file_station_webui/js/upload.js:47 — upload.run 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.
D1 · Cyclomatic Complexity · ModelArtifactRecognizer.validateLlm (cyclomatic 23) · ×1
  • ModelArtifactRecognizer.validateLlm (cyclomatic 23) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:375 — ModelArtifactRecognizer.validateLlm has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: ModelArtifactRecognizer.artifactRoleForManualSelection (cyclomatic 34) 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.
D1 · Cyclomatic Complexity · LiteRtLmWorkerClient.streamBackendChat (cyclomatic 23) · ×1
  • LiteRtLmWorkerClient.streamBackendChat (cyclomatic 23) app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:843 — LiteRtLmWorkerClient.streamBackendChat has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · QuadtrixTrainingService.handleProgressClient (cyclomatic 23) · ×1
  • QuadtrixTrainingService.handleProgressClient (cyclomatic 23) app/src/main/java/com/example/llamadroid/service/QuadtrixTrainingService.kt:751 — QuadtrixTrainingService.handleProgressClient has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · VideoGenerationService.convertNativeOutput (cyclomatic 23) · ×1
  • VideoGenerationService.convertNativeOutput (cyclomatic 23) app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:852 — VideoGenerationService.convertNativeOutput 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.
D1 · Cyclomatic Complexity · TamaAgentService.generateAssistantReply (cyclomatic 23) · ×1
  • TamaAgentService.generateAssistantReply (cyclomatic 23) app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:408 — TamaAgentService.generateAssistantReply 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.
D1 · Cyclomatic Complexity · TamaGameEngine.updateForTimePassedLocked (cyclomatic 23) · ×1
  • TamaGameEngine.updateForTimePassedLocked (cyclomatic 23) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:315 — TamaGameEngine.updateForTimePassedLocked 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.
D1 · Cyclomatic Complexity · TamaMapViewKt.LocationDetailsDialog (cyclomatic 23) · ×1
  • TamaMapViewKt.LocationDetailsDialog (cyclomatic 23) app/src/main/java/com/example/llamadroid/tama/ui/TamaMapView.kt:285 — TamaMapViewKt.LocationDetailsDialog 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.
D1 · Cyclomatic Complexity · NativeHarnessCommandHistoryKt.mergeNativeHarnessCommandRuns (cyclomatic 23) · ×1
  • NativeHarnessCommandHistoryKt.mergeNativeHarnessCommandRuns (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCommandHistory.kt:43 — NativeHarnessCommandHistoryKt.mergeNativeHarnessCommandRuns has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · NativeHarnessController.applyFollowFrame (cyclomatic 23) · ×1
  • NativeHarnessController.applyFollowFrame (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:2053 — NativeHarnessController.applyFollowFrame 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.
D1 · Cyclomatic Complexity · NativeHarnessPluginActions.cancel (cyclomatic 23) · ×1
  • NativeHarnessPluginActions.cancel (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessPluginActions.kt:272 — NativeHarnessPluginActions.cancel 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.
D1 · Cyclomatic Complexity · NativeHarnessSettingsReader.readSettings (cyclomatic 23) · ×1
  • NativeHarnessSettingsReader.readSettings (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessSettingsReader.kt:54 — NativeHarnessSettingsReader.readSettings 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.
D1 · Cyclomatic Complexity · WorkflowsScreenKt.WorkflowOutputGalleryCard (cyclomatic 23) · ×1
  • WorkflowsScreenKt.WorkflowOutputGalleryCard (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3186 — WorkflowsScreenKt.WorkflowOutputGalleryCard 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.
D1 · Cyclomatic Complexity · WorkflowsScreenKt.MediaDubbingTranslationWorkflowContent (cyclomatic 23) · ×1
  • WorkflowsScreenKt.MediaDubbingTranslationWorkflowContent (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4734 — WorkflowsScreenKt.MediaDubbingTranslationWorkflowContent has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · MarkdownTextKt.buildInlineAnnotated (cyclomatic 23) · ×1
  • MarkdownTextKt.buildInlineAnnotated (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:637 — MarkdownTextKt.buildInlineAnnotated 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.
D1 · Cyclomatic Complexity · VideoRuntimeOptionsEditorKt.VideoRuntimeOptionsEditor (cyclomatic 23) · ×1
  • VideoRuntimeOptionsEditorKt.VideoRuntimeOptionsEditor (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/components/VideoRuntimeOptionsEditor.kt:82 — VideoRuntimeOptionsEditorKt.VideoRuntimeOptionsEditor 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.
D1 · Cyclomatic Complexity · VideoUiAvailabilityKt.clearUnavailableAdvancedSelections (cyclomatic 23) · ×1
  • VideoUiAvailabilityKt.clearUnavailableAdvancedSelections (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/components/VideoUiAvailability.kt:115 — VideoUiAvailabilityKt.clearUnavailableAdvancedSelections has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · EasyChatTabKt.EasyChatTab (cyclomatic 23) · ×1
  • EasyChatTabKt.EasyChatTab (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/easy/EasyChatTab.kt:63 — EasyChatTabKt.EasyChatTab 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.
D1 · Cyclomatic Complexity · EasyModelImporterKt.EasyModelImportSection (cyclomatic 23) · ×1
  • EasyModelImporterKt.EasyModelImportSection (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/easy/EasyModelImporter.kt:294 — EasyModelImporterKt.EasyModelImportSection has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ModelManagerScreenKt.DiscoverTab (cyclomatic 23) · ×1
  • ModelManagerScreenKt.DiscoverTab (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1296 — ModelManagerScreenKt.DiscoverTab has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ModelSourceAttachmentKt.ModelSourceAttachmentDialog (cyclomatic 23) · ×1
  • ModelSourceAttachmentKt.ModelSourceAttachmentDialog (cyclomatic 23) app/src/main/java/com/example/llamadroid/ui/models/ModelSourceAttachment.kt:233 — ModelSourceAttachmentKt.ModelSourceAttachmentDialog has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ModelSourceAttachmentKt.installedAssetForModel (cyclomatic 41) 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.
D1 · Cyclomatic Complexity · TamaPetWidgetKt.resolveLocationType (cyclomatic 23) · ×1
  • TamaPetWidgetKt.resolveLocationType (cyclomatic 23) app/src/main/java/com/example/llamadroid/widget/TamaPetWidget.kt:509 — TamaPetWidgetKt.resolveLocationType has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · app.renderField (cyclomatic 23) · ×1
  • app.renderField (cyclomatic 23) app/src/main/assets/ai_servers_webui/app.js:537 — app.renderField 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.
D1 · Cyclomatic Complexity · ModelArtifactRecognizer.isLikelyWhisperFile (cyclomatic 22) · ×1
  • ModelArtifactRecognizer.isLikelyWhisperFile (cyclomatic 22) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:841 — ModelArtifactRecognizer.isLikelyWhisperFile 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: ModelArtifactRecognizer.artifactRoleForManualSelection (cyclomatic 34) 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.
D1 · Cyclomatic Complexity · SdArtifactInspector.inspectSafeTensors (cyclomatic 22) · ×1
  • SdArtifactInspector.inspectSafeTensors (cyclomatic 22) app/src/main/java/com/example/llamadroid/sd/SdArtifactInspector.kt:189 — SdArtifactInspector.inspectSafeTensors 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.
D1 · Cyclomatic Complexity · AgentDurableContractStore.normalizeAgentReportOutcome (cyclomatic 22) · ×1
  • AgentDurableContractStore.normalizeAgentReportOutcome (cyclomatic 22) app/src/main/java/com/example/llamadroid/service/AgentDurableContractStore.kt:1963 — AgentDurableContractStore.normalizeAgentReportOutcome 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.
D1 · Cyclomatic Complexity · ToolHttpServer.legacyActionFrom (cyclomatic 22) · ×1
  • ToolHttpServer.legacyActionFrom (cyclomatic 22) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:1601 — ToolHttpServer.legacyActionFrom 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.
D1 · Cyclomatic Complexity · BenchmarkService.runBenchmark (cyclomatic 22) · ×1
  • BenchmarkService.runBenchmark (cyclomatic 22) app/src/main/java/com/example/llamadroid/service/BenchmarkService.kt:218 — BenchmarkService.runBenchmark 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.
D1 · Cyclomatic Complexity · PDFService.readJpegDimensions (cyclomatic 22) · ×1
  • PDFService.readJpegDimensions (cyclomatic 22) app/src/main/java/com/example/llamadroid/service/PDFService.kt:6848 — PDFService.readJpegDimensions 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.
D1 · Cyclomatic Complexity · DelegateSubagentLoop.mainLoop (cyclomatic 22) · ×1
  • DelegateSubagentLoop.mainLoop (cyclomatic 22) app/src/main/java/com/example/llamadroid/service/delegation/DelegateSubagentLoop.kt:219 — DelegateSubagentLoop.mainLoop 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.
D1 · Cyclomatic Complexity · DelegationStatusFormatter.statusText (cyclomatic 22) · ×1
  • DelegationStatusFormatter.statusText (cyclomatic 22) app/src/main/java/com/example/llamadroid/service/delegation/DelegationStatusFormatter.kt:38 — DelegationStatusFormatter.statusText 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.
D1 · Cyclomatic Complexity · AgentCoordinationSupportKt.shouldSurfaceColdRecovery (cyclomatic 22) · ×1
  • AgentCoordinationSupportKt.shouldSurfaceColdRecovery (cyclomatic 22) app/src/main/java/com/example/llamadroid/ui/agent/AgentCoordinationSupport.kt:113 — AgentCoordinationSupportKt.shouldSurfaceColdRecovery has cyclomatic complexity 22 (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.
D1 · Cyclomatic Complexity · SoftStudioAppScaffoldKt.SoftStudioAppScaffold (cyclomatic 22) · ×1
  • SoftStudioAppScaffoldKt.SoftStudioAppScaffold (cyclomatic 22) app/src/main/java/com/example/llamadroid/ui/navigation/SoftStudioAppScaffold.kt:76 — SoftStudioAppScaffoldKt.SoftStudioAppScaffold 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.
D1 · Cyclomatic Complexity · SystemMonitor.readCpu (cyclomatic 22) · ×1
  • SystemMonitor.readCpu (cyclomatic 22) app/src/main/java/com/example/llamadroid/util/SystemMonitor.kt:114 — SystemMonitor.readCpu 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.
D1 · Cyclomatic Complexity · WearCompanionBridgeManager.routeCommand (cyclomatic 22) · ×1
  • WearCompanionBridgeManager.routeCommand (cyclomatic 22) app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:362 — WearCompanionBridgeManager.routeCommand 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.
D1 · Cyclomatic Complexity · StableAudio3Request.validate (cyclomatic 21) · ×1
  • StableAudio3Request.validate (cyclomatic 21) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3Models.kt:278 — StableAudio3Request.validate has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · StableAudio3WorkerClient.run (cyclomatic 21) · ×1
  • StableAudio3WorkerClient.run (cyclomatic 21) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3WorkerClient.kt:21 — StableAudio3WorkerClient.run has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LlamaServerLaunchProfile.migrateJson (cyclomatic 21) · ×1
  • LlamaServerLaunchProfile.migrateJson (cyclomatic 21) app/src/main/java/com/example/llamadroid/service/LlamaServerLaunchProfile.kt:390 — LlamaServerLaunchProfile.migrateJson 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.
D1 · Cyclomatic Complexity · MangaPaintedOcrSupport.analyzeMask (cyclomatic 21) · ×1
  • MangaPaintedOcrSupport.analyzeMask (cyclomatic 21) app/src/main/java/com/example/llamadroid/service/MangaPaintedOcrSupport.kt:191 — MangaPaintedOcrSupport.analyzeMask 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.
D1 · Cyclomatic Complexity · TamaAgentService.summarize (cyclomatic 21) · ×1
  • TamaAgentService.summarize (cyclomatic 21) app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:658 — TamaAgentService.summarize 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.
D1 · Cyclomatic Complexity · AdventureGateCombatEngine.applyPetDamage (cyclomatic 21) · ×1
  • AdventureGateCombatEngine.applyPetDamage (cyclomatic 21) app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateCombatEngine.kt:756 — AdventureGateCombatEngine.applyPetDamage 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. This is NOT this file's highest cyclomatic complexity: AdventureGateCombatEngine.eventsFromLogs (cyclomatic 22) 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.
D1 · Cyclomatic Complexity · FarmLivestockScreenKt.FarmLivestockScreen (cyclomatic 21) · ×1
  • FarmLivestockScreenKt.FarmLivestockScreen (cyclomatic 21) app/src/main/java/com/example/llamadroid/tama/ui/FarmLivestockScreen.kt:132 — FarmLivestockScreenKt.FarmLivestockScreen 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.
D1 · Cyclomatic Complexity · AgentDialogsKt.AgentConfigCard (cyclomatic 21) · ×1
  • AgentDialogsKt.AgentConfigCard (cyclomatic 21) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4131 — AgentDialogsKt.AgentConfigCard 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.
D1 · Cyclomatic Complexity · VideoGenScreenKt.VideoDetailDialog (cyclomatic 21) · ×1
  • VideoGenScreenKt.VideoDetailDialog (cyclomatic 21) app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:2147 — VideoGenScreenKt.VideoDetailDialog 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.
D1 · Cyclomatic Complexity · ChatTopBarKt.ChatTopBar (cyclomatic 21) · ×1
  • ChatTopBarKt.ChatTopBar (cyclomatic 21) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatTopBar.kt:64 — ChatTopBarKt.ChatTopBar 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.
D1 · Cyclomatic Complexity · DelegationSubagentTabKt.RowCard (cyclomatic 21) · ×1
  • DelegationSubagentTabKt.RowCard (cyclomatic 21) app/src/main/java/com/example/llamadroid/ui/ai/llama/delegation/DelegationSubagentTab.kt:128 — DelegationSubagentTabKt.RowCard 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.
D1 · Cyclomatic Complexity · NativeChatDelegationScreenKt.DelegationHeader (cyclomatic 21) · ×1
  • NativeChatDelegationScreenKt.DelegationHeader (cyclomatic 21) app/src/main/java/com/example/llamadroid/ui/ai/llama/delegation/NativeChatDelegationScreen.kt:139 — NativeChatDelegationScreenKt.DelegationHeader 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.
D1 · Cyclomatic Complexity · CuratedModelBundleSectionKt.CuratedModelBundleCard (cyclomatic 21) · ×1
  • CuratedModelBundleSectionKt.CuratedModelBundleCard (cyclomatic 21) app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:517 — CuratedModelBundleSectionKt.CuratedModelBundleCard 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.
D1 · Cyclomatic Complexity · DownloadTaskSectionKt.DownloadTaskCard (cyclomatic 21) · ×1
  • DownloadTaskSectionKt.DownloadTaskCard (cyclomatic 21) app/src/main/java/com/example/llamadroid/ui/components/DownloadTaskSection.kt:237 — DownloadTaskSectionKt.DownloadTaskCard 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.
D1 · Cyclomatic Complexity · WalkthroughStateKt.tourTarget (cyclomatic 21) · ×1
  • WalkthroughStateKt.tourTarget (cyclomatic 21) app/src/main/java/com/example/llamadroid/ui/walkthrough/WalkthroughState.kt:208 — WalkthroughStateKt.tourTarget 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.
D1 · Cyclomatic Complexity · preview.openPreview (cyclomatic 21) · ×1
  • preview.openPreview (cyclomatic 21) app/src/main/assets/file_station_webui/js/preview.js:60 — preview.openPreview has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (show, a function literal at line 115, a function literal at line 76, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · HarnessRuntimeController.reconcileStaleLocked (cyclomatic 20) · ×1
  • HarnessRuntimeController.reconcileStaleLocked (cyclomatic 20) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:1171 — HarnessRuntimeController.reconcileStaleLocked has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentProjectControlPlane.buildControlPacket (cyclomatic 20) · ×1
  • AgentProjectControlPlane.buildControlPacket (cyclomatic 20) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:2349 — AgentProjectControlPlane.buildControlPacket has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LiteRtLmReflectionBridge.generateStreaming (cyclomatic 20) · ×1
  • LiteRtLmReflectionBridge.generateStreaming (cyclomatic 20) app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:1551 — LiteRtLmReflectionBridge.generateStreaming 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.
D1 · Cyclomatic Complexity · LlamaScheduledTaskRunner.runTask (cyclomatic 20) · ×1
  • LlamaScheduledTaskRunner.runTask (cyclomatic 20) app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskRunner.kt:35 — LlamaScheduledTaskRunner.runTask has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProcessControllerKt.resolveManagedLlamaCustomFlags (cyclomatic 20) · ×1
  • ProcessControllerKt.resolveManagedLlamaCustomFlags (cyclomatic 20) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:1503 — ProcessControllerKt.resolveManagedLlamaCustomFlags 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.
D1 · Cyclomatic Complexity · VideoUpscalerService.upscaleFrames (cyclomatic 20) · ×1
  • VideoUpscalerService.upscaleFrames (cyclomatic 20) app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:431 — VideoUpscalerService.upscaleFrames 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.
D1 · Cyclomatic Complexity · TamaGameEngine.buyItemLocked (cyclomatic 20) · ×1
  • TamaGameEngine.buyItemLocked (cyclomatic 20) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2694 — TamaGameEngine.buyItemLocked has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TamaChatServerSettingsKt.TamaChatSettingsDialog (cyclomatic 20) · ×1
  • TamaChatServerSettingsKt.TamaChatSettingsDialog (cyclomatic 20) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:82 — TamaChatServerSettingsKt.TamaChatSettingsDialog 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.
D1 · Cyclomatic Complexity · AgentControlsKt.ConnectionStatusBar (cyclomatic 20) · ×1
  • AgentControlsKt.ConnectionStatusBar (cyclomatic 20) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:637 — AgentControlsKt.ConnectionStatusBar 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.
D1 · Cyclomatic Complexity · HarnessRuntimeInstallationsKt.RuntimeInstallationCard (cyclomatic 20) · ×1
  • HarnessRuntimeInstallationsKt.RuntimeInstallationCard (cyclomatic 20) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeInstallations.kt:397 — HarnessRuntimeInstallationsKt.RuntimeInstallationCard has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SDModelsScreenKt.SDModelsScreen (cyclomatic 20) · ×1
  • SDModelsScreenKt.SDModelsScreen (cyclomatic 20) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:185 — SDModelsScreenKt.SDModelsScreen has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: SDModelsScreenKt.selectionTypeForModel (cyclomatic 24) 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.
D1 · Cyclomatic Complexity · ChatComposerKt.ChatComposer (cyclomatic 20) · ×1
  • ChatComposerKt.ChatComposer (cyclomatic 20) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatComposer.kt:144 — ChatComposerKt.ChatComposer has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChatMessageListKt.ChatMessageList (cyclomatic 20) · ×1
  • ChatMessageListKt.ChatMessageList (cyclomatic 20) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageList.kt:37 — ChatMessageListKt.ChatMessageList has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AudioWorkspaceModelsKt.validationErrors (cyclomatic 20) · ×1
  • AudioWorkspaceModelsKt.validationErrors (cyclomatic 20) app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceModels.kt:304 — AudioWorkspaceModelsKt.validationErrors has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AssetDownloadDialogKt.AssetDownloadDialog (cyclomatic 20) · ×1
  • AssetDownloadDialogKt.AssetDownloadDialog (cyclomatic 20) app/src/main/java/com/example/llamadroid/ui/components/AssetDownloadDialog.kt:33 — AssetDownloadDialogKt.AssetDownloadDialog 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.
D1 · Cyclomatic Complexity · ModelLibraryScreenKt.ModelLibraryScreen (cyclomatic 20) · ×1
  • ModelLibraryScreenKt.ModelLibraryScreen (cyclomatic 20) app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryScreen.kt:113 — ModelLibraryScreenKt.ModelLibraryScreen has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ModelLibraryScreenKt.modelLibraryErrorResource (cyclomatic 43) 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.
D1 · Cyclomatic Complexity · GeneralSettingsScreenKt.NativeBinaryCatalogSheet (cyclomatic 20) · ×1
  • GeneralSettingsScreenKt.NativeBinaryCatalogSheet (cyclomatic 20) app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:1240 — GeneralSettingsScreenKt.NativeBinaryCatalogSheet has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DynamicFeatureManager.installOptionalAccelerators (cyclomatic 20) · ×1
  • DynamicFeatureManager.installOptionalAccelerators (cyclomatic 20) app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:263 — DynamicFeatureManager.installOptionalAccelerators has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DynamicFeatureManager.installModule (cyclomatic 20) · ×1
  • DynamicFeatureManager.installModule (cyclomatic 20) app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:365 — DynamicFeatureManager.installModule has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · GGUFParser.readModelInfo (cyclomatic 20) · ×1
  • GGUFParser.readModelInfo (cyclomatic 20) app/src/main/java/com/example/llamadroid/util/GGUFParser.kt:39 — GGUFParser.readModelInfo 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.
D1 · Cyclomatic Complexity · app.collectParams (cyclomatic 20) · ×1
  • app.collectParams (cyclomatic 20) app/src/main/assets/ai_servers_webui/app.js:1583 — app.collectParams has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1586, 1615). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · RestoreCoordinator.installPending (cyclomatic 19) · ×1
  • RestoreCoordinator.installPending (cyclomatic 19) app/src/main/java/com/example/llamadroid/data/db/RestoreCoordinator.kt:265 — RestoreCoordinator.installPending 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.
D1 · Cyclomatic Complexity · HarnessTerminalDialogKt.HarnessTerminalDialog (cyclomatic 19) · ×1
  • HarnessTerminalDialogKt.HarnessTerminalDialog (cyclomatic 19) app/src/main/java/com/example/llamadroid/harness/HarnessTerminalDialog.kt:39 — HarnessTerminalDialogKt.HarnessTerminalDialog has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · AgentProjectControlPlane.classifyVerificationCheck (cyclomatic 19) · ×1
  • AgentProjectControlPlane.classifyVerificationCheck (cyclomatic 19) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:403 — AgentProjectControlPlane.classifyVerificationCheck has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · LlamaServerSessionRuntime.launchProcess (cyclomatic 19) · ×1
  • LlamaServerSessionRuntime.launchProcess (cyclomatic 19) app/src/main/java/com/example/llamadroid/service/LlamaServerSessionRuntime.kt:403 — LlamaServerSessionRuntime.launchProcess 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.
D1 · Cyclomatic Complexity · PDFService.translatePageUnits (cyclomatic 19) · ×1
  • PDFService.translatePageUnits (cyclomatic 19) app/src/main/java/com/example/llamadroid/service/PDFService.kt:1299 — PDFService.translatePageUnits 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.
D1 · Cyclomatic Complexity · QuadtrixTrainingService.startProfile (cyclomatic 19) · ×1
  • QuadtrixTrainingService.startProfile (cyclomatic 19) app/src/main/java/com/example/llamadroid/service/QuadtrixTrainingService.kt:119 — QuadtrixTrainingService.startProfile 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.
D1 · Cyclomatic Complexity · SdProgressTracker.recognizePhase (cyclomatic 19) · ×1
  • SdProgressTracker.recognizePhase (cyclomatic 19) app/src/main/java/com/example/llamadroid/service/SdProgressSupport.kt:222 — SdProgressTracker.recognizePhase has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · VideoInterpolationService.runRife (cyclomatic 19) · ×1
  • VideoInterpolationService.runRife (cyclomatic 19) app/src/main/java/com/example/llamadroid/service/VideoInterpolationService.kt:555 — VideoInterpolationService.runRife has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ToolSpec.parse (cyclomatic 19) · ×1
  • ToolSpec.parse (cyclomatic 19) app/src/main/java/com/example/llamadroid/service/filestation/api/ToolsApi.kt:456 — ToolSpec.parse 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.
D1 · Cyclomatic Complexity · TamaArcadeSessionRules.validate (cyclomatic 19) · ×1
  • TamaArcadeSessionRules.validate (cyclomatic 19) app/src/main/java/com/example/llamadroid/tama/game/TamaArcadeSessionRules.kt:39 — TamaArcadeSessionRules.validate has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PetTransferCoordinator.runOutbound (cyclomatic 19) · ×1
  • PetTransferCoordinator.runOutbound (cyclomatic 19) app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:244 — PetTransferCoordinator.runOutbound 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.
D1 · Cyclomatic Complexity · PetTransferServer.hello (cyclomatic 19) · ×1
  • PetTransferServer.hello (cyclomatic 19) app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferServer.kt:149 — PetTransferServer.hello 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.
D1 · Cyclomatic Complexity · ArcadeMemoryGameKt.MemoryCardTile (cyclomatic 19) · ×1
  • ArcadeMemoryGameKt.MemoryCardTile (cyclomatic 19) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:490 — ArcadeMemoryGameKt.MemoryCardTile 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.
D1 · Cyclomatic Complexity · AgentControlsKt.AgentContextWindowBanner (cyclomatic 19) · ×1
  • AgentControlsKt.AgentContextWindowBanner (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:978 — AgentControlsKt.AgentContextWindowBanner 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.
D1 · Cyclomatic Complexity · AgentDialogsKt.AgentTuningCard (cyclomatic 19) · ×1
  • AgentDialogsKt.AgentTuningCard (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3440 — AgentDialogsKt.AgentTuningCard 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.
D1 · Cyclomatic Complexity · AgentWorkspaceScreenKt.AgentWorkspaceRunTab (cyclomatic 19) · ×1
  • AgentWorkspaceScreenKt.AgentWorkspaceRunTab (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:2245 — AgentWorkspaceScreenKt.AgentWorkspaceRunTab has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · HarnessGoalPanelKt.HarnessGoalPanel (cyclomatic 19) · ×1
  • HarnessGoalPanelKt.HarnessGoalPanel (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessGoalPanel.kt:27 — HarnessGoalPanelKt.HarnessGoalPanel 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.
D1 · Cyclomatic Complexity · GenerationQueueScreenKt.GenerationQueueHistoryScreen (cyclomatic 19) · ×1
  • GenerationQueueScreenKt.GenerationQueueHistoryScreen (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/ai/GenerationQueueScreen.kt:284 — GenerationQueueScreenKt.GenerationQueueHistoryScreen 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.
D1 · Cyclomatic Complexity · InpaintMaskEditorKt.InpaintMaskEditorContent (cyclomatic 19) · ×1
  • InpaintMaskEditorKt.InpaintMaskEditorContent (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:148 — InpaintMaskEditorKt.InpaintMaskEditorContent 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.
D1 · Cyclomatic Complexity · VideoReuseDialogKt.VideoReuseDialog (cyclomatic 19) · ×1
  • VideoReuseDialogKt.VideoReuseDialog (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/ai/VideoReuseDialog.kt:24 — VideoReuseDialogKt.VideoReuseDialog 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.
D1 · Cyclomatic Complexity · ChatDelegationSettingsSectionKt.ChatDelegationSettingsSection (cyclomatic 19) · ×1
  • ChatDelegationSettingsSectionKt.ChatDelegationSettingsSection (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatDelegationSettingsSection.kt:72 — ChatDelegationSettingsSectionKt.ChatDelegationSettingsSection 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.
D1 · Cyclomatic Complexity · ServerDetailSheetKt.ServerDetailSheet (cyclomatic 19) · ×1
  • ServerDetailSheetKt.ServerDetailSheet (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/ServerDetailSheet.kt:84 — ServerDetailSheetKt.ServerDetailSheet 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.
D1 · Cyclomatic Complexity · VideoInputPickerKt.VideoInputPicker (cyclomatic 19) · ×1
  • VideoInputPickerKt.VideoInputPicker (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/components/VideoInputPicker.kt:33 — VideoInputPickerKt.VideoInputPicker 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.
D1 · Cyclomatic Complexity · DatasetProjectScreenKt.DatasetProjectScreen (cyclomatic 19) · ×1
  • DatasetProjectScreenKt.DatasetProjectScreen (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:109 — DatasetProjectScreenKt.DatasetProjectScreen has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AllMediaGalleryScreenKt.AllMediaGalleryScreen (cyclomatic 19) · ×1
  • AllMediaGalleryScreenKt.AllMediaGalleryScreen (cyclomatic 19) app/src/main/java/com/example/llamadroid/ui/library/AllMediaGalleryScreen.kt:106 — AllMediaGalleryScreenKt.AllMediaGalleryScreen 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.
D1 · Cyclomatic Complexity · picker.pickFolder (cyclomatic 19) · ×1
  • picker.pickFolder (cyclomatic 19) app/src/main/assets/file_station_webui/js/picker.js:8 — picker.pickFolder has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (show, a function literal at line 51, row, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · main.route (cyclomatic 19) · ×1
  • main.route (cyclomatic 19) app/src/main/assets/file_station_webui/js/main.js:57 — main.route 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.
D1 · Cyclomatic Complexity · SettingsRepository.migrateDirectAgentSettingsPreferences (cyclomatic 18) · ×1
  • SettingsRepository.migrateDirectAgentSettingsPreferences (cyclomatic 18) app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:245 — SettingsRepository.migrateDirectAgentSettingsPreferences has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: SettingsRepository.normalizeStableDiffusionNativeBinarySelection (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ModelArtifactRecognizer.isLikelyOnnxFile (cyclomatic 18) · ×1
  • ModelArtifactRecognizer.isLikelyOnnxFile (cyclomatic 18) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:579 — ModelArtifactRecognizer.isLikelyOnnxFile has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ModelArtifactRecognizer.artifactRoleForManualSelection (cyclomatic 34) 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.
D1 · Cyclomatic Complexity · ModelSourceRepository.saveSource (cyclomatic 18) · ×1
  • ModelSourceRepository.saveSource (cyclomatic 18) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:207 — ModelSourceRepository.saveSource 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.
D1 · Cyclomatic Complexity · AgentDurableContractStore.parsePatchArtifactEntries (cyclomatic 18) · ×1
  • AgentDurableContractStore.parsePatchArtifactEntries (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/AgentDurableContractStore.kt:441 — AgentDurableContractStore.parsePatchArtifactEntries has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · AgentPreviewBridge.interact (cyclomatic 18) · ×1
  • AgentPreviewBridge.interact (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/AgentPreviewBridge.kt:267 — AgentPreviewBridge.interact has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AgentProjectControlPlane.todoOutcomeForReport (cyclomatic 18) · ×1
  • AgentProjectControlPlane.todoOutcomeForReport (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:3142 — AgentProjectControlPlane.todoOutcomeForReport 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.
D1 · Cyclomatic Complexity · ToolHttpServer.validateModelCapabilities (cyclomatic 18) · ×1
  • ToolHttpServer.validateModelCapabilities (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:1484 — ToolHttpServer.validateModelCapabilities has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · DeepResearchSupport.scoreCandidate (cyclomatic 18) · ×1
  • DeepResearchSupport.scoreCandidate (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/DeepResearchSupport.kt:190 — DeepResearchSupport.scoreCandidate 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.
D1 · Cyclomatic Complexity · LlamaClientService.selectLiteRtToolsForPrompt (cyclomatic 18) · ×1
  • LlamaClientService.selectLiteRtToolsForPrompt (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:2930 — LlamaClientService.selectLiteRtToolsForPrompt has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: LlamaClientService.statusTextForToolCall (cyclomatic 33) 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.
D1 · Cyclomatic Complexity · MediaTranslationWorkflowService.runProcessWithSrtProgress (cyclomatic 18) · ×1
  • MediaTranslationWorkflowService.runProcessWithSrtProgress (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:2656 — MediaTranslationWorkflowService.runProcessWithSrtProgress 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.
D1 · Cyclomatic Complexity · NativeChatToolRuntime.fetchUrlText (cyclomatic 18) · ×1
  • NativeChatToolRuntime.fetchUrlText (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2450 — NativeChatToolRuntime.fetchUrlText has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: NativeChatToolRuntime.parseOptionalNoteType (cyclomatic 19) 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.
D1 · Cyclomatic Complexity · OllamaService.performChatWithToolsStreaming (cyclomatic 18) · ×1
  • OllamaService.performChatWithToolsStreaming (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/OllamaService.kt:535 — OllamaService.performChatWithToolsStreaming 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.
D1 · Cyclomatic Complexity · PDFTranslationLogic.extractFlexibleTranslations (cyclomatic 18) · ×1
  • PDFTranslationLogic.extractFlexibleTranslations (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/PDFTranslationLogic.kt:528 — PDFTranslationLogic.extractFlexibleTranslations has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ProcessControllerKt.migrateLegacyLlamaManagedSettings (cyclomatic 18) · ×1
  • ProcessControllerKt.migrateLegacyLlamaManagedSettings (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:1666 — ProcessControllerKt.migrateLegacyLlamaManagedSettings 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.
D1 · Cyclomatic Complexity · ProcessControllerKt.filterManagedLlamaCustomFlags (cyclomatic 18) · ×1
  • ProcessControllerKt.filterManagedLlamaCustomFlags (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:1753 — ProcessControllerKt.filterManagedLlamaCustomFlags 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.
D1 · Cyclomatic Complexity · SdAdetailerSupportKt.validateSdADetailerConfig (cyclomatic 18) · ×1
  • SdAdetailerSupportKt.validateSdADetailerConfig (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/SdAdetailerSupport.kt:72 — SdAdetailerSupportKt.validateSdADetailerConfig 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.
D1 · Cyclomatic Complexity · SdDistributedRuntimeKt.buildRamWeightedSdPlacementPlan (cyclomatic 18) · ×1
  • SdDistributedRuntimeKt.buildRamWeightedSdPlacementPlan (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/SdDistributedRuntime.kt:234 — SdDistributedRuntimeKt.buildRamWeightedSdPlacementPlan 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.
D1 · Cyclomatic Complexity · StableDiffusionService.onStartCommand (cyclomatic 18) · ×1
  • StableDiffusionService.onStartCommand (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:176 — StableDiffusionService.onStartCommand 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.
D1 · Cyclomatic Complexity · DelegationProjectFiles.search (cyclomatic 18) · ×1
  • DelegationProjectFiles.search (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/delegation/DelegationProjectFiles.kt:131 — DelegationProjectFiles.search 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.
D1 · Cyclomatic Complexity · VolumeRegistry.transferNamed (cyclomatic 18) · ×1
  • VolumeRegistry.transferNamed (cyclomatic 18) app/src/main/java/com/example/llamadroid/service/filestation/volume/VolumeRegistry.kt:109 — VolumeRegistry.transferNamed 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.
D1 · Cyclomatic Complexity · ShimejiMotion.chooseNext (cyclomatic 18) · ×1
  • ShimejiMotion.chooseNext (cyclomatic 18) app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiMotion.kt:328 — ShimejiMotion.chooseNext has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: ShimejiMotion.clipFor (cyclomatic 24) 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.
D1 · Cyclomatic Complexity · AgentDialogsKt.AgentDirectRuntimeCard (cyclomatic 18) · ×1
  • AgentDialogsKt.AgentDirectRuntimeCard (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2471 — AgentDialogsKt.AgentDirectRuntimeCard 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.
D1 · Cyclomatic Complexity · AgentWorkspaceScreenKt.AgentWorkspacePreviewTab (cyclomatic 18) · ×1
  • AgentWorkspaceScreenKt.AgentWorkspacePreviewTab (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:2505 — AgentWorkspaceScreenKt.AgentWorkspacePreviewTab 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.
D1 · Cyclomatic Complexity · HarnessScreenKt.HarnessSessionCard (cyclomatic 18) · ×1
  • HarnessScreenKt.HarnessSessionCard (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1210 — HarnessScreenKt.HarnessSessionCard 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.
D1 · Cyclomatic Complexity · NativeHarnessStructuredTranscriptKt.parseNativeHarnessStructuredTranscript (cyclomatic 18) · ×1
  • NativeHarnessStructuredTranscriptKt.parseNativeHarnessStructuredTranscript (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessStructuredTranscript.kt:130 — NativeHarnessStructuredTranscriptKt.parseNativeHarnessStructuredTranscript 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.
D1 · Cyclomatic Complexity · NativeHarnessStructuredTranscriptActions.loadDetail (cyclomatic 18) · ×1
  • NativeHarnessStructuredTranscriptActions.loadDetail (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessStructuredTranscriptActions.kt:29 — NativeHarnessStructuredTranscriptActions.loadDetail 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.
D1 · Cyclomatic Complexity · LiveTranslatorScreenKt.LiveTranslatorBackendCard (cyclomatic 18) · ×1
  • LiveTranslatorScreenKt.LiveTranslatorBackendCard (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/ai/LiveTranslatorScreen.kt:800 — LiveTranslatorScreenKt.LiveTranslatorBackendCard 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.
D1 · Cyclomatic Complexity · OnnxTtsScreenKt.OnnxTtsScreen (cyclomatic 18) · ×1
  • OnnxTtsScreenKt.OnnxTtsScreen (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/ai/OnnxTtsScreen.kt:88 — OnnxTtsScreenKt.OnnxTtsScreen 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.
D1 · Cyclomatic Complexity · TermuxScreenKt.ToolRunItem (cyclomatic 18) · ×1
  • TermuxScreenKt.ToolRunItem (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:1490 — TermuxScreenKt.ToolRunItem 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.
D1 · Cyclomatic Complexity · CuratedModelBundleSectionKt.CuratedModelBundleSection (cyclomatic 18) · ×1
  • CuratedModelBundleSectionKt.CuratedModelBundleSection (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:268 — CuratedModelBundleSectionKt.CuratedModelBundleSection has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · EasyImagesTabKt.EasyImageRunCard (cyclomatic 18) · ×1
  • EasyImagesTabKt.EasyImageRunCard (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/easy/EasyImagesTab.kt:324 — EasyImagesTabKt.EasyImageRunCard has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · KiwixViewerScreenKt.KiwixViewerScreen (cyclomatic 18) · ×1
  • KiwixViewerScreenKt.KiwixViewerScreen (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/kiwix/KiwixViewerScreen.kt:48 — KiwixViewerScreenKt.KiwixViewerScreen 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.
D1 · Cyclomatic Complexity · ModelShareScreenKt.ModelShareScreen (cyclomatic 18) · ×1
  • ModelShareScreenKt.ModelShareScreen (cyclomatic 18) app/src/main/java/com/example/llamadroid/ui/models/ModelShareScreen.kt:53 — ModelShareScreenKt.ModelShareScreen 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.
D1 · Cyclomatic Complexity · app.syncActiveChatState (cyclomatic 18) · ×1
  • app.syncActiveChatState (cyclomatic 18) app/src/main/assets/ai_servers_webui/app.js:431 — app.syncActiveChatState has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AudioGenerationService.runJob (cyclomatic 17) · ×1
  • AudioGenerationService.runJob (cyclomatic 17) app/src/main/java/com/example/llamadroid/audio/AudioGenerationService.kt:293 — AudioGenerationService.runJob 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.
D1 · Cyclomatic Complexity · StableAudio3ModelDoctor.inspectFile (cyclomatic 17) · ×1
  • StableAudio3ModelDoctor.inspectFile (cyclomatic 17) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3ModelDoctor.kt:309 — StableAudio3ModelDoctor.inspectFile 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.
D1 · Cyclomatic Complexity · BinaryRepository.resolveLlamaBinary (cyclomatic 17) · ×1
  • BinaryRepository.resolveLlamaBinary (cyclomatic 17) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:191 — BinaryRepository.resolveLlamaBinary 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.
D1 · Cyclomatic Complexity · ModelRepository.downloadModel (cyclomatic 17) · ×1
  • ModelRepository.downloadModel (cyclomatic 17) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:325 — ModelRepository.downloadModel has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ModelRepositoryKt.isStableDiffusionArtifact (cyclomatic 19) 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.
D1 · Cyclomatic Complexity · ModelArtifactRecognizer.validateSd (cyclomatic 17) · ×1
  • ModelArtifactRecognizer.validateSd (cyclomatic 17) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:283 — ModelArtifactRecognizer.validateSd has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: ModelArtifactRecognizer.artifactRoleForManualSelection (cyclomatic 34) 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.
D1 · Cyclomatic Complexity · HarnessImageParts.rewrite (cyclomatic 17) · ×1
  • HarnessImageParts.rewrite (cyclomatic 17) app/src/main/java/com/example/llamadroid/harness/HarnessImageParts.kt:44 — HarnessImageParts.rewrite 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.
D1 · Cyclomatic Complexity · HarnessLocalModels.streamLlamaServer (cyclomatic 17) · ×1
  • HarnessLocalModels.streamLlamaServer (cyclomatic 17) app/src/main/java/com/example/llamadroid/harness/HarnessLocalModels.kt:723 — HarnessLocalModels.streamLlamaServer 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.
D1 · Cyclomatic Complexity · HarnessReferencesDialogKt.HarnessReferencesDialog (cyclomatic 17) · ×1
  • HarnessReferencesDialogKt.HarnessReferencesDialog (cyclomatic 17) app/src/main/java/com/example/llamadroid/harness/HarnessReferencesDialog.kt:40 — HarnessReferencesDialogKt.HarnessReferencesDialog 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.
D1 · Cyclomatic Complexity · HarnessTerminalScreenUiKt.composeHarnessTerminalKeySequence (cyclomatic 17) · ×1
  • HarnessTerminalScreenUiKt.composeHarnessTerminalKeySequence (cyclomatic 17) app/src/main/java/com/example/llamadroid/harness/HarnessTerminalScreenUi.kt:101 — HarnessTerminalScreenUiKt.composeHarnessTerminalKeySequence 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.
D1 · Cyclomatic Complexity · HarnessTransferMappings.review (cyclomatic 17) · ×1
  • HarnessTransferMappings.review (cyclomatic 17) app/src/main/java/com/example/llamadroid/harness/HarnessTransferMappings.kt:30 — HarnessTransferMappings.review 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.
D1 · Cyclomatic Complexity · AgentControlPromptSupportKt.projectAgentReportForControlPacket (cyclomatic 17) · ×1
  • AgentControlPromptSupportKt.projectAgentReportForControlPacket (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:230 — AgentControlPromptSupportKt.projectAgentReportForControlPacket 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.
D1 · Cyclomatic Complexity · AgentProjectControlPlane.applyVerificationResult (cyclomatic 17) · ×1
  • AgentProjectControlPlane.applyVerificationResult (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:697 — AgentProjectControlPlane.applyVerificationResult 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.
D1 · Cyclomatic Complexity · AgentRemoteChatClient.chatWithOwnedSession (cyclomatic 17) · ×1
  • AgentRemoteChatClient.chatWithOwnedSession (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/AgentRemoteChatWorkerService.kt:444 — AgentRemoteChatClient.chatWithOwnedSession 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.
D1 · Cyclomatic Complexity · AgentRuntimeSupport.tokenizeArgvTemplate (cyclomatic 17) · ×1
  • AgentRuntimeSupport.tokenizeArgvTemplate (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:1614 — AgentRuntimeSupport.tokenizeArgvTemplate has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · AgentService.persistFrozenTurnContext (cyclomatic 17) · ×1
  • AgentService.persistFrozenTurnContext (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/AgentService.kt:4371 — AgentService.persistFrozenTurnContext 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. This is NOT this file's highest cyclomatic complexity: AgentService.toolExampleJson (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · AgentService.addMessage (cyclomatic 17) · ×1
  • AgentService.addMessage (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/AgentService.kt:6635 — AgentService.addMessage 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. This is NOT this file's highest cyclomatic complexity: AgentService.toolExampleJson (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · AgentService.packMessagesForContextOnce (cyclomatic 17) · ×1
  • AgentService.packMessagesForContextOnce (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/AgentService.kt:15615 — AgentService.packMessagesForContextOnce 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. This is NOT this file's highest cyclomatic complexity: AgentService.toolExampleJson (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · AgentService.normalizeMessageForPrompt (cyclomatic 17) · ×1
  • AgentService.normalizeMessageForPrompt (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/AgentService.kt:15773 — AgentService.normalizeMessageForPrompt has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AgentService.toolExampleJson (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · LiteRtTextGenerationClient.streamSafely (cyclomatic 17) · ×1
  • LiteRtTextGenerationClient.streamSafely (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/LiteRtTextGenerationClient.kt:153 — LiteRtTextGenerationClient.streamSafely 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.
D1 · Cyclomatic Complexity · LlamaServerSessionRuntime.start (cyclomatic 17) · ×1
  • LlamaServerSessionRuntime.start (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/LlamaServerSessionRuntime.kt:175 — LlamaServerSessionRuntime.start 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.
D1 · Cyclomatic Complexity · LlamaServerSessionService.onStartCommand (cyclomatic 17) · ×1
  • LlamaServerSessionService.onStartCommand (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/LlamaServerSessionService.kt:46 — LlamaServerSessionService.onStartCommand 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.
D1 · Cyclomatic Complexity · PDFService.translationGroupsShouldMerge (cyclomatic 17) · ×1
  • PDFService.translationGroupsShouldMerge (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/PDFService.kt:1878 — PDFService.translationGroupsShouldMerge has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · PDFService.detectBubbleOcrRegions (cyclomatic 17) · ×1
  • PDFService.detectBubbleOcrRegions (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/PDFService.kt:5118 — PDFService.detectBubbleOcrRegions has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · RemoteMasterServer.handleRestart (cyclomatic 17) · ×1
  • RemoteMasterServer.handleRestart (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:392 — RemoteMasterServer.handleRestart 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.
D1 · Cyclomatic Complexity · SdLaunchPreflightKt.resolveSdPipelineForLaunch (cyclomatic 17) · ×1
  • SdLaunchPreflightKt.resolveSdPipelineForLaunch (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/SdLaunchPreflight.kt:30 — SdLaunchPreflightKt.resolveSdPipelineForLaunch 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.
D1 · Cyclomatic Complexity · VideoSumupService.transcribe (cyclomatic 17) · ×1
  • VideoSumupService.transcribe (cyclomatic 17) app/src/main/java/com/example/llamadroid/service/VideoSumupService.kt:436 — VideoSumupService.transcribe 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.
D1 · Cyclomatic Complexity · TamaArcadeSessionRules.rewardFor (cyclomatic 17) · ×1
  • TamaArcadeSessionRules.rewardFor (cyclomatic 17) app/src/main/java/com/example/llamadroid/tama/game/TamaArcadeSessionRules.kt:122 — TamaArcadeSessionRules.rewardFor 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.
D1 · Cyclomatic Complexity · AdventureGateArenaKt.EnemySprite (cyclomatic 17) · ×1
  • AdventureGateArenaKt.EnemySprite (cyclomatic 17) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:485 — AdventureGateArenaKt.EnemySprite 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.
D1 · Cyclomatic Complexity · ArcadeScreenKt.advanceCatchGame (cyclomatic 17) · ×1
  • ArcadeScreenKt.advanceCatchGame (cyclomatic 17) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:1503 — ArcadeScreenKt.advanceCatchGame 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.
D1 · Cyclomatic Complexity · FarmLayoutKt.UpgradeItem (cyclomatic 17) · ×1
  • FarmLayoutKt.UpgradeItem (cyclomatic 17) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmLayout.kt:228 — FarmLayoutKt.UpgradeItem 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.
D1 · Cyclomatic Complexity · FarmTilesKt.FarmTileItem (cyclomatic 17) · ×1
  • FarmTilesKt.FarmTileItem (cyclomatic 17) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmTiles.kt:75 — FarmTilesKt.FarmTileItem 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.
D1 · Cyclomatic Complexity · AgentControlsKt.AgentWorkspaceConsoleHeader (cyclomatic 17) · ×1
  • AgentControlsKt.AgentWorkspaceConsoleHeader (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:243 — AgentControlsKt.AgentWorkspaceConsoleHeader 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.
D1 · Cyclomatic Complexity · HarnessCommandsTabKt.HarnessCommandRunCard (cyclomatic 17) · ×1
  • HarnessCommandsTabKt.HarnessCommandRunCard (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessCommandsTab.kt:157 — HarnessCommandsTabKt.HarnessCommandRunCard 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.
D1 · Cyclomatic Complexity · HarnessConversationPanelKt.HarnessChatTab (cyclomatic 17) · ×1
  • HarnessConversationPanelKt.HarnessChatTab (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessConversationPanel.kt:31 — HarnessConversationPanelKt.HarnessChatTab 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.
D1 · Cyclomatic Complexity · HarnessExtensionsPanelsKt.HarnessPluginRow (cyclomatic 17) · ×1
  • HarnessExtensionsPanelsKt.HarnessPluginRow (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessExtensionsPanels.kt:480 — HarnessExtensionsPanelsKt.HarnessPluginRow has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · HarnessRecoveryToolsKt.RecoveryTerminalControls (cyclomatic 17) · ×1
  • HarnessRecoveryToolsKt.RecoveryTerminalControls (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRecoveryTools.kt:294 — HarnessRecoveryToolsKt.RecoveryTerminalControls 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.
D1 · Cyclomatic Complexity · HarnessRuntimeTransferKt.ImportTransferBody (cyclomatic 17) · ×1
  • HarnessRuntimeTransferKt.ImportTransferBody (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeTransfer.kt:587 — HarnessRuntimeTransferKt.ImportTransferBody 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.
D1 · Cyclomatic Complexity · NativeHarnessProviderSaveKt.buildNativeHarnessProviderSavePlan (cyclomatic 17) · ×1
  • NativeHarnessProviderSaveKt.buildNativeHarnessProviderSavePlan (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProviderSave.kt:23 — NativeHarnessProviderSaveKt.buildNativeHarnessProviderSavePlan has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · NativeHarnessProviderSaveKt.parseProviderField (cyclomatic 17) · ×1
  • NativeHarnessProviderSaveKt.parseProviderField (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProviderSave.kt:95 — NativeHarnessProviderSaveKt.parseProviderField 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.
D1 · Cyclomatic Complexity · NativeHarnessStructuredTranscriptPanelKt.NativeHarnessStructuredTranscriptCard (cyclomatic 17) · ×1
  • NativeHarnessStructuredTranscriptPanelKt.NativeHarnessStructuredTranscriptCard (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessStructuredTranscriptPanel.kt:43 — NativeHarnessStructuredTranscriptPanelKt.NativeHarnessStructuredTranscriptCard 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.
D1 · Cyclomatic Complexity · PageReader.read (cyclomatic 17) · ×1
  • PageReader.read (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnActions.kt:396 — PageReader.read 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.
D1 · Cyclomatic Complexity · NativeHarnessTurnDetailsKt.nativeHarnessUsageFromEvent (cyclomatic 17) · ×1
  • NativeHarnessTurnDetailsKt.nativeHarnessUsageFromEvent (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetails.kt:704 — NativeHarnessTurnDetailsKt.nativeHarnessUsageFromEvent 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.
D1 · Cyclomatic Complexity · ImageGenScreenKt.SdParamsBackendProfileControls (cyclomatic 17) · ×1
  • ImageGenScreenKt.SdParamsBackendProfileControls (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4848 — ImageGenScreenKt.SdParamsBackendProfileControls 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.
D1 · Cyclomatic Complexity · EasyLlamaChatUiKt.EasyLlamaChatEntryCard (cyclomatic 17) · ×1
  • EasyLlamaChatUiKt.EasyLlamaChatEntryCard (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/ai/llama/EasyLlamaChatUi.kt:221 — EasyLlamaChatUiKt.EasyLlamaChatEntryCard 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.
D1 · Cyclomatic Complexity · LocalServerFormKt.validateLocalForm (cyclomatic 17) · ×1
  • LocalServerFormKt.validateLocalForm (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/LocalServerForm.kt:117 — LocalServerFormKt.validateLocalForm 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.
D1 · Cyclomatic Complexity · OllamaManagerScreenKt.ModelList (cyclomatic 17) · ×1
  • OllamaManagerScreenKt.ModelList (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/ai/ollama/OllamaManagerScreen.kt:568 — OllamaManagerScreenKt.ModelList 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.
D1 · Cyclomatic Complexity · AudioWorkspaceRuntimeController.toUiModel (cyclomatic 17) · ×1
  • AudioWorkspaceRuntimeController.toUiModel (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceRuntimeController.kt:671 — AudioWorkspaceRuntimeController.toUiModel 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.
D1 · Cyclomatic Complexity · ChatScreenKt.ChatScreen (cyclomatic 17) · ×1
  • ChatScreenKt.ChatScreen (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/chat/ChatScreen.kt:74 — ChatScreenKt.ChatScreen 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.
D1 · Cyclomatic Complexity · AppChromeKt.AppHubRow (cyclomatic 17) · ×1
  • AppChromeKt.AppHubRow (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/components/AppChrome.kt:478 — AppChromeKt.AppHubRow 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.
D1 · Cyclomatic Complexity · EasyChatModelPickerKt.EasyChatModelPicker (cyclomatic 17) · ×1
  • EasyChatModelPickerKt.EasyChatModelPicker (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/easy/EasyChatModelPicker.kt:48 — EasyChatModelPickerKt.EasyChatModelPicker has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · FileStationScreenKt.StatusSection (cyclomatic 17) · ×1
  • FileStationScreenKt.StatusSection (cyclomatic 17) app/src/main/java/com/example/llamadroid/ui/filestation/FileStationScreen.kt:236 — FileStationScreenKt.StatusSection 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.
D1 · Cyclomatic Complexity · MainActivityKt.OrganizerScreen (cyclomatic 17) · ×1
  • MainActivityKt.OrganizerScreen (cyclomatic 17) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2243 — MainActivityKt.OrganizerScreen has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: MainActivityKt.WearCompanionApp (cyclomatic 20) 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.
D1 · Cyclomatic Complexity · app.renderMessageAttachments (cyclomatic 17) · ×1
  • app.renderMessageAttachments (cyclomatic 17) app/src/main/assets/ai_servers_webui/app.js:1478 — app.renderMessageAttachments has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · dialogs.h (cyclomatic 17) · ×1
  • dialogs.h (cyclomatic 17) app/src/main/assets/file_station_webui/js/dialogs.js:4 — dialogs.h has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · browser.initBrowser (cyclomatic 17) · ×1
  • browser.initBrowser (cyclomatic 17) app/src/main/assets/file_station_webui/js/browser.js:227 — browser.initBrowser has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 257, 230, 253, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AudioGenerationService.onStartCommand (cyclomatic 16) · ×1
  • AudioGenerationService.onStartCommand (cyclomatic 16) app/src/main/java/com/example/llamadroid/audio/AudioGenerationService.kt:59 — AudioGenerationService.onStartCommand has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ModelArtifactRecognizer.validateAudio (cyclomatic 16) · ×1
  • ModelArtifactRecognizer.validateAudio (cyclomatic 16) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:519 — ModelArtifactRecognizer.validateAudio has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: ModelArtifactRecognizer.artifactRoleForManualSelection (cyclomatic 34) 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.
D1 · Cyclomatic Complexity · ProotManager.extractRootfs (cyclomatic 16) · ×1
  • ProotManager.extractRootfs (cyclomatic 16) app/src/main/java/com/example/llamadroid/data/proot/ProotManager.kt:111 — ProotManager.extractRootfs 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.
D1 · Cyclomatic Complexity · HarnessBridgeOperations.image (cyclomatic 16) · ×1
  • HarnessBridgeOperations.image (cyclomatic 16) app/src/main/java/com/example/llamadroid/harness/HarnessBridgeOperations.kt:416 — HarnessBridgeOperations.image 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.
D1 · Cyclomatic Complexity · HarnessOriginalWebViewKt.scheduleHarnessWebViewBootProbe (cyclomatic 16) · ×1
  • HarnessOriginalWebViewKt.scheduleHarnessWebViewBootProbe (cyclomatic 16) app/src/main/java/com/example/llamadroid/harness/HarnessOriginalWebView.kt:338 — HarnessOriginalWebViewKt.scheduleHarnessWebViewBootProbe 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.
D1 · Cyclomatic Complexity · HarnessProjectManagement.loadGroup (cyclomatic 16) · ×1
  • HarnessProjectManagement.loadGroup (cyclomatic 16) app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:539 — HarnessProjectManagement.loadGroup 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.
D1 · Cyclomatic Complexity · HarnessTermuxTransportViewKt.composeHarnessTermuxCodePoint (cyclomatic 16) · ×1
  • HarnessTermuxTransportViewKt.composeHarnessTermuxCodePoint (cyclomatic 16) app/src/main/java/com/example/llamadroid/harness/HarnessTermuxTransportView.kt:632 — HarnessTermuxTransportViewKt.composeHarnessTermuxCodePoint has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · HarnessTransferMetadata.snapshot (cyclomatic 16) · ×1
  • HarnessTransferMetadata.snapshot (cyclomatic 16) app/src/main/java/com/example/llamadroid/harness/HarnessTransferMetadata.kt:255 — HarnessTransferMetadata.snapshot has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · HarnessWebIndexBodyKt.readHarnessWebIndexBody (cyclomatic 16) · ×1
  • HarnessWebIndexBodyKt.readHarnessWebIndexBody (cyclomatic 16) app/src/main/java/com/example/llamadroid/harness/HarnessWebIndexBody.kt:8 — HarnessWebIndexBodyKt.readHarnessWebIndexBody 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.
D1 · Cyclomatic Complexity · OkHttpHarnessClient.fetchJson (cyclomatic 16) · ×1
  • OkHttpHarnessClient.fetchJson (cyclomatic 16) app/src/main/java/com/example/llamadroid/harness/client/OkHttpHarnessClient.kt:289 — OkHttpHarnessClient.fetchJson 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.
D1 · Cyclomatic Complexity · HarnessRuntimeController.recover (cyclomatic 16) · ×1
  • HarnessRuntimeController.recover (cyclomatic 16) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:235 — HarnessRuntimeController.recover 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.
D1 · Cyclomatic Complexity · HarnessTransferCodec.validateEntrySemantics (cyclomatic 16) · ×1
  • HarnessTransferCodec.validateEntrySemantics (cyclomatic 16) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:1180 — HarnessTransferCodec.validateEntrySemantics has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AgentForegroundService.onStartCommand (cyclomatic 16) · ×1
  • AgentForegroundService.onStartCommand (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/AgentForegroundService.kt:461 — AgentForegroundService.onStartCommand has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentPlanProposalRecoveryKt.recoverImplementationPlanProse (cyclomatic 16) · ×1
  • AgentPlanProposalRecoveryKt.recoverImplementationPlanProse (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/AgentPlanProposalRecovery.kt:91 — AgentPlanProposalRecoveryKt.recoverImplementationPlanProse 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.
D1 · Cyclomatic Complexity · AgentService.buildStructuredBrainState (cyclomatic 16) · ×1
  • AgentService.buildStructuredBrainState (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/AgentService.kt:19546 — AgentService.buildStructuredBrainState has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: AgentService.toolExampleJson (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · AgentService.setIsLoading (cyclomatic 16) · ×1
  • AgentService.setIsLoading (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/AgentService.kt:3141 — AgentService.setIsLoading has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AgentService.toolExampleJson (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · AgentToolSchemaPolicy.compactSchemaObject (cyclomatic 16) · ×1
  • AgentToolSchemaPolicy.compactSchemaObject (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/AgentToolSchemaPolicy.kt:359 — AgentToolSchemaPolicy.compactSchemaObject has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ToolHttpServer.startPdfToolJob (cyclomatic 16) · ×1
  • ToolHttpServer.startPdfToolJob (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:1775 — ToolHttpServer.startPdfToolJob has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ToolHttpServer.serveMedia (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · TombstoneWireReader.message (cyclomatic 16) · ×1
  • TombstoneWireReader.message (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/AndroidTombstoneSummary.kt:97 — TombstoneWireReader.message 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.
D1 · Cyclomatic Complexity · DownloadService.finalizePendingDownload (cyclomatic 16) · ×1
  • DownloadService.finalizePendingDownload (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/DownloadService.kt:1791 — DownloadService.finalizePendingDownload 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.
D1 · Cyclomatic Complexity · LiteRtLmChatServiceKt.splitLiteRtDocumentedChannelText (cyclomatic 16) · ×1
  • LiteRtLmChatServiceKt.splitLiteRtDocumentedChannelText (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:2408 — LiteRtLmChatServiceKt.splitLiteRtDocumentedChannelText has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LlamaClientService.streamLiteRtLmRequestSafely (cyclomatic 16) · ×1
  • LlamaClientService.streamLiteRtLmRequestSafely (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:2708 — LlamaClientService.streamLiteRtLmRequestSafely has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: LlamaClientService.statusTextForToolCall (cyclomatic 33) 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.
D1 · Cyclomatic Complexity · NativeChatLocalServerStarter.ensureReady (cyclomatic 16) · ×1
  • NativeChatLocalServerStarter.ensureReady (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/NativeChatLocalServerStarter.kt:72 — NativeChatLocalServerStarter.ensureReady has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · NativeCalculatorParser.parseNumber (cyclomatic 16) · ×1
  • NativeCalculatorParser.parseNumber (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:4160 — NativeCalculatorParser.parseNumber has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: NativeChatToolRuntime.parseOptionalNoteType (cyclomatic 19) 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.
D1 · Cyclomatic Complexity · PDFService.recognizePaintedTextBlocksWithLlama (cyclomatic 16) · ×1
  • PDFService.recognizePaintedTextBlocksWithLlama (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/PDFService.kt:4028 — PDFService.recognizePaintedTextBlocksWithLlama 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.
D1 · Cyclomatic Complexity · PDFTranslationJobService.startTextLayerPdfTranslationBatch (cyclomatic 16) · ×1
  • PDFTranslationJobService.startTextLayerPdfTranslationBatch (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/PDFTranslationJobService.kt:103 — PDFTranslationJobService.startTextLayerPdfTranslationBatch 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.
D1 · Cyclomatic Complexity · RemoteMasterServer.handleDownload (cyclomatic 16) · ×1
  • RemoteMasterServer.handleDownload (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:517 — RemoteMasterServer.handleDownload 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.
D1 · Cyclomatic Complexity · StableDiffusionService.postProcessOutputIfNeeded (cyclomatic 16) · ×1
  • StableDiffusionService.postProcessOutputIfNeeded (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1684 — StableDiffusionService.postProcessOutputIfNeeded 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.
D1 · Cyclomatic Complexity · TamaDeepDreamService.runDeepDream (cyclomatic 16) · ×1
  • TamaDeepDreamService.runDeepDream (cyclomatic 16) app/src/main/java/com/example/llamadroid/service/TamaDeepDreamService.kt:99 — TamaDeepDreamService.runDeepDream 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.
D1 · Cyclomatic Complexity · TamaGameEngine.usePotionLocked (cyclomatic 16) · ×1
  • TamaGameEngine.usePotionLocked (cyclomatic 16) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:918 — TamaGameEngine.usePotionLocked 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.
D1 · Cyclomatic Complexity · TamaGameEngine.startActivityLocked (cyclomatic 16) · ×1
  • TamaGameEngine.startActivityLocked (cyclomatic 16) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1526 — TamaGameEngine.startActivityLocked has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TamaStudySessionSupport.advanceActiveSession (cyclomatic 16) · ×1
  • TamaStudySessionSupport.advanceActiveSession (cyclomatic 16) app/src/main/java/com/example/llamadroid/tama/game/TamaStudySessionSupport.kt:79 — TamaStudySessionSupport.advanceActiveSession 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.
D1 · Cyclomatic Complexity · ShimejiOverlayService.configureTouch (cyclomatic 16) · ×1
  • ShimejiOverlayService.configureTouch (cyclomatic 16) app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiOverlayService.kt:556 — ShimejiOverlayService.configureTouch 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.
D1 · Cyclomatic Complexity · PetTransferServer.upload (cyclomatic 16) · ×1
  • PetTransferServer.upload (cyclomatic 16) app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferServer.kt:249 — PetTransferServer.upload 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.
D1 · Cyclomatic Complexity · StoreScreenKt.StoreItemRow (cyclomatic 16) · ×1
  • StoreScreenKt.StoreItemRow (cyclomatic 16) app/src/main/java/com/example/llamadroid/tama/ui/StoreScreen.kt:551 — StoreScreenKt.StoreItemRow 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.
D1 · Cyclomatic Complexity · FarmActionController.batch (cyclomatic 16) · ×1
  • FarmActionController.batch (cyclomatic 16) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmActionController.kt:46 — FarmActionController.batch 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.
D1 · Cyclomatic Complexity · FarmPetBrain.step (cyclomatic 16) · ×1
  • FarmPetBrain.step (cyclomatic 16) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmAmbientModel.kt:131 — FarmPetBrain.step 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.
D1 · Cyclomatic Complexity · AgentChatListKt.AgentChatList (cyclomatic 16) · ×1
  • AgentChatListKt.AgentChatList (cyclomatic 16) app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:372 — AgentChatListKt.AgentChatList 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.
D1 · Cyclomatic Complexity · HarnessInlineLinksKt.parseHarnessInlineDestination (cyclomatic 16) · ×1
  • HarnessInlineLinksKt.parseHarnessInlineDestination (cyclomatic 16) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessInlineLinks.kt:18 — HarnessInlineLinksKt.parseHarnessInlineDestination 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.
D1 · Cyclomatic Complexity · HarnessScreenKt.HarnessSchemaFieldControl (cyclomatic 16) · ×1
  • HarnessScreenKt.HarnessSchemaFieldControl (cyclomatic 16) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1876 — HarnessScreenKt.HarnessSchemaFieldControl 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.
D1 · Cyclomatic Complexity · NativeHarnessProviderCreationKt.validateNativeCustomProviderRequest (cyclomatic 16) · ×1
  • NativeHarnessProviderCreationKt.validateNativeCustomProviderRequest (cyclomatic 16) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProviderCreation.kt:146 — NativeHarnessProviderCreationKt.validateNativeCustomProviderRequest 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.
D1 · Cyclomatic Complexity · AIHubScreenKt.ToolsTab (cyclomatic 16) · ×1
  • AIHubScreenKt.ToolsTab (cyclomatic 16) app/src/main/java/com/example/llamadroid/ui/ai/AIHubScreen.kt:135 — AIHubScreenKt.ToolsTab 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.
D1 · Cyclomatic Complexity · SDModelsScreenKt.SdInspectionEvidence (cyclomatic 16) · ×1
  • SDModelsScreenKt.SdInspectionEvidence (cyclomatic 16) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:3187 — SDModelsScreenKt.SdInspectionEvidence has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: SDModelsScreenKt.selectionTypeForModel (cyclomatic 24) 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.
D1 · Cyclomatic Complexity · ChatServerBannerKt.ChatServerBanner (cyclomatic 16) · ×1
  • ChatServerBannerKt.ChatServerBanner (cyclomatic 16) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatServerBanner.kt:28 — ChatServerBannerKt.ChatServerBanner has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · VideoRuntimeOptionsEditorKt.ComponentPathsEditor (cyclomatic 16) · ×1
  • VideoRuntimeOptionsEditorKt.ComponentPathsEditor (cyclomatic 16) app/src/main/java/com/example/llamadroid/ui/components/VideoRuntimeOptionsEditor.kt:474 — VideoRuntimeOptionsEditorKt.ComponentPathsEditor has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · DashboardKiwixCardKt.DashboardKiwixCard (cyclomatic 16) · ×1
  • DashboardKiwixCardKt.DashboardKiwixCard (cyclomatic 16) app/src/main/java/com/example/llamadroid/ui/dashboard/DashboardKiwixCard.kt:60 — DashboardKiwixCardKt.DashboardKiwixCard 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.
D1 · Cyclomatic Complexity · DatasetProjectScreenKt.ChunksTab (cyclomatic 16) · ×1
  • DatasetProjectScreenKt.ChunksTab (cyclomatic 16) app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:877 — DatasetProjectScreenKt.ChunksTab 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.
D1 · Cyclomatic Complexity · ModelLibraryScreenKt.ModelBundleCard (cyclomatic 16) · ×1
  • ModelLibraryScreenKt.ModelBundleCard (cyclomatic 16) app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryScreen.kt:1250 — ModelLibraryScreenKt.ModelBundleCard has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: ModelLibraryScreenKt.modelLibraryErrorResource (cyclomatic 43) 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.
D1 · Cyclomatic Complexity · MainActivityKt.PetScreen (cyclomatic 16) · ×1
  • MainActivityKt.PetScreen (cyclomatic 16) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2077 — MainActivityKt.PetScreen has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: MainActivityKt.WearCompanionApp (cyclomatic 20) 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.
D17 · Explicit Debt · TodoComment · ×1
  • TodoComment app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:1808 — // only collapses the runtime TODO projection; an explicitly legacy — 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.
D2 · Cognitive Complexity · ImageGenScreenKt.ImageGenScreen (cognitive 738) · ×1
  • ImageGenScreenKt.ImageGenScreen (cognitive 738) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:140 — ImageGenScreenKt.ImageGenScreen has cognitive complexity 738 (threshold 15). Drivers by points: if/else 327 (549 pts), boolean chains 93, match/switch 42 (64 pts), error handling 20 (32 pts) (nesting depth added 256). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.sendMessage (cognitive 511) · ×1
  • AgentService.sendMessage (cognitive 511) app/src/main/java/com/example/llamadroid/service/AgentService.kt:8199 — AgentService.sendMessage has cognitive complexity 511 (threshold 15). Drivers by points: if/else 287 (402 pts), boolean chains 83, match/switch 10 (15 pts), error handling 3 (7 pts), loops 2 (4 pts) (nesting depth added 126). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.executeToolCall (cognitive 467) · ×1
  • AgentService.executeToolCall (cognitive 467) app/src/main/java/com/example/llamadroid/service/AgentService.kt:11014 — AgentService.executeToolCall has cognitive complexity 467 (threshold 15). Drivers by points: if/else 218 (375 pts), boolean chains 70, error handling 6 (14 pts), match/switch 3 (6 pts), loops 1 (2 pts) (nesting depth added 169). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaService.startServer (cognitive 403) · ×1
  • LlamaService.startServer (cognitive 403) app/src/main/java/com/example/llamadroid/service/LlamaService.kt:585 — LlamaService.startServer has cognitive complexity 403 (threshold 15). Drivers by points: if/else 222 (294 pts), boolean chains 75, match/switch 22 (27 pts), error handling 3 (5 pts), loops 2 (nesting depth added 79). 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.
D2 · Cognitive Complexity · MasterModeScreenKt.RemoteMasterCard (cognitive 359) · ×1
  • MasterModeScreenKt.RemoteMasterCard (cognitive 359) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:3845 — MasterModeScreenKt.RemoteMasterCard has cognitive complexity 359 (threshold 15). Drivers by points: if/else 105 (252 pts), error handling 20 (59 pts), loops 6 (20 pts), boolean chains 18, match/switch 3 (10 pts) (nesting depth added 207). 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.
D2 · Cognitive Complexity · MasterModeScreenKt.MasterModeScreen (cognitive 358) · ×1
  • MasterModeScreenKt.MasterModeScreen (cognitive 358) app/src/main/java/com/example/llamadroid/ui/distributed/MasterModeScreen.kt:121 — MasterModeScreenKt.MasterModeScreen has cognitive complexity 358 (threshold 15). Drivers by points: if/else 181 (277 pts), boolean chains 52, match/switch 18 (27 pts), error handling 2 (nesting depth added 105). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaChatScreenKt.LlamaChatScreen (cognitive 209) · ×1
  • LlamaChatScreenKt.LlamaChatScreen (cognitive 209) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt:99 — LlamaChatScreenKt.LlamaChatScreen has cognitive complexity 209 (threshold 15). Drivers by points: if/else 121 (147 pts), boolean chains 48, error handling 6 (11 pts), match/switch 2, loops 1 (nesting depth added 31). 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.
D2 · Cognitive Complexity · AgentWorkspaceScreenKt.AgentWorkspaceScreen (cognitive 205) · ×1
  • AgentWorkspaceScreenKt.AgentWorkspaceScreen (cognitive 205) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:130 — AgentWorkspaceScreenKt.AgentWorkspaceScreen has cognitive complexity 205 (threshold 15). Drivers by points: if/else 108 (157 pts), boolean chains 27, match/switch 5 (11 pts), error handling 4 (10 pts) (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFToolboxScreenKt.PDFToolboxScreen (cognitive 188) · ×1
  • PDFToolboxScreenKt.PDFToolboxScreen (cognitive 188) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:67 — PDFToolboxScreenKt.PDFToolboxScreen has cognitive complexity 188 (threshold 15). Drivers by points: if/else 61 (161 pts), boolean chains 16, error handling 4 (6 pts), match/switch 2 (5 pts) (nesting depth added 105). 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.
D2 · Cognitive Complexity · TamaScreenKt.TamaScreen (cognitive 181) · ×1
  • TamaScreenKt.TamaScreen (cognitive 181) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:149 — TamaScreenKt.TamaScreen has cognitive complexity 181 (threshold 15). Drivers by points: if/else 96 (137 pts), boolean chains 30, error handling 3 (6 pts), match/switch 5 (6 pts), loops 2 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaServerChatService.performChatWithToolsStreaming (cognitive 171) · ×1
  • LlamaServerChatService.performChatWithToolsStreaming (cognitive 171) app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt:479 — LlamaServerChatService.performChatWithToolsStreaming has cognitive complexity 171 (threshold 15). Drivers by points: if/else 50 (140 pts), match/switch 4 (11 pts), error handling 4 (7 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 104). 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.
D2 · Cognitive Complexity · DownloadService.startDownloadInternal (cognitive 156) · ×1
  • DownloadService.startDownloadInternal (cognitive 156) app/src/main/java/com/example/llamadroid/service/DownloadService.kt:565 — DownloadService.startDownloadInternal has cognitive complexity 156 (threshold 15). Drivers by points: if/else 70 (123 pts), error handling 6 (16 pts), boolean chains 15, match/switch 1 (2 pts) (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowsScreenKt.WorkflowsScreen (cognitive 141) · ×1
  • WorkflowsScreenKt.WorkflowsScreen (cognitive 141) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:98 — WorkflowsScreenKt.WorkflowsScreen has cognitive complexity 141 (threshold 15). Drivers by points: if/else 62 (84 pts), error handling 8 (22 pts), boolean chains 19, match/switch 8 (13 pts), loops 2 (3 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OnnxImageGenScreenKt.OnnxImageGenScreen (cognitive 140) · ×1
  • OnnxImageGenScreenKt.OnnxImageGenScreen (cognitive 140) app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:149 — OnnxImageGenScreenKt.OnnxImageGenScreen has cognitive complexity 140 (threshold 15). Drivers by points: if/else 56 (97 pts), boolean chains 24, match/switch 9 (19 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SDModelsScreenKt.InstalledSDModelsTab (cognitive 140) · ×1
  • SDModelsScreenKt.InstalledSDModelsTab (cognitive 140) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:700 — SDModelsScreenKt.InstalledSDModelsTab has cognitive complexity 140 (threshold 15). Drivers by points: if/else 66 (105 pts), boolean chains 31, error handling 2, match/switch 1 (2 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessAgentRouteKt.HarnessCapturedAgentRoute (cognitive 139) · ×1
  • HarnessAgentRouteKt.HarnessCapturedAgentRoute (cognitive 139) app/src/main/java/com/example/llamadroid/harness/HarnessAgentRoute.kt:148 — HarnessAgentRouteKt.HarnessCapturedAgentRoute has cognitive complexity 139 (threshold 15). Drivers by points: if/else 78 (92 pts), error handling 17 (21 pts), boolean chains 20, match/switch 3 (6 pts) (nesting depth added 21). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SdDistributedScreensKt.SdDistributedMasterScreen (cognitive 139) · ×1
  • SdDistributedScreensKt.SdDistributedMasterScreen (cognitive 139) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:616 — SdDistributedScreensKt.SdDistributedMasterScreen has cognitive complexity 139 (threshold 15). Drivers by points: if/else 90 (105 pts), boolean chains 25, match/switch 5, error handling 4 (nesting depth added 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentRuntimeProfileControlsKt.AgentRuntimeProfileControls (cognitive 134) · ×1
  • AgentRuntimeProfileControlsKt.AgentRuntimeProfileControls (cognitive 134) app/src/main/java/com/example/llamadroid/ui/agent/AgentRuntimeProfileControls.kt:103 — AgentRuntimeProfileControlsKt.AgentRuntimeProfileControls has cognitive complexity 134 (threshold 15). Drivers by points: if/else 62 (95 pts), match/switch 14 (20 pts), boolean chains 19 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoGenScreenKt.VideoGenScreen (cognitive 131) · ×1
  • VideoGenScreenKt.VideoGenScreen (cognitive 131) app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:195 — VideoGenScreenKt.VideoGenScreen has cognitive complexity 131 (threshold 15). Drivers by points: if/else 69 (88 pts), boolean chains 31, error handling 6, match/switch 5 (6 pts) (nesting depth added 20). 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.
D2 · Cognitive Complexity · LlamaService.onStartCommand (cognitive 124) · ×1
  • LlamaService.onStartCommand (cognitive 124) app/src/main/java/com/example/llamadroid/service/LlamaService.kt:311 — LlamaService.onStartCommand has cognitive complexity 124 (threshold 15). Drivers by points: if/else 80 (120 pts), boolean chains 2, error handling 1, match/switch 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LLMSettingsScreenKt.LlmSettingsContent (cognitive 121) · ×1
  • LLMSettingsScreenKt.LlmSettingsContent (cognitive 121) app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:92 — LLMSettingsScreenKt.LlmSettingsContent has cognitive complexity 121 (threshold 15). Drivers by points: if/else 66 (100 pts), match/switch 6 (13 pts), boolean chains 8 (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.
D2 · Cognitive Complexity · RemoteServerFormKt.RemoteServerForm (cognitive 114) · ×1
  • RemoteServerFormKt.RemoteServerForm (cognitive 114) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/RemoteServerForm.kt:65 — RemoteServerFormKt.RemoteServerForm has cognitive complexity 114 (threshold 15). Drivers by points: if/else 76 (93 pts), boolean chains 20, match/switch 1 (nesting depth added 17). 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.
D2 · Cognitive Complexity · Downloader.download (cognitive 113) · ×1
  • Downloader.download (cognitive 113) app/src/main/java/com/example/llamadroid/util/Downloader.kt:38 — Downloader.download has cognitive complexity 113 (threshold 15). Drivers by points: if/else 46 (89 pts), boolean chains 15, error handling 4 (6 pts), loops 2 (3 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.validateToolCall (cognitive 111) · ×1
  • AgentService.validateToolCall (cognitive 111) app/src/main/java/com/example/llamadroid/service/AgentService.kt:16676 — AgentService.validateToolCall has cognitive complexity 111 (threshold 15). Drivers by points: if/else 53 (75 pts), boolean chains 27, match/switch 7 (9 pts) (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.
D2 · Cognitive Complexity · BinaryRepository.findTieredBinary (cognitive 105) · ×1
  • BinaryRepository.findTieredBinary (cognitive 105) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:785 — BinaryRepository.findTieredBinary has cognitive complexity 105 (threshold 15). Drivers by points: if/else 25 (68 pts), loops 12 (32 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 64). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AdventureGateScreenKt.AdventureGateBattleView (cognitive 105) · ×1
  • AdventureGateScreenKt.AdventureGateBattleView (cognitive 105) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:2657 — AdventureGateScreenKt.AdventureGateBattleView has cognitive complexity 105 (threshold 15). Drivers by points: if/else 62 (81 pts), boolean chains 14, match/switch 7 (10 pts) (nesting depth added 22). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentDialogsKt.AgentSettingsDialog (cognitive 103) · ×1
  • AgentDialogsKt.AgentSettingsDialog (cognitive 103) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:848 — AgentDialogsKt.AgentSettingsDialog has cognitive complexity 103 (threshold 15). Drivers by points: if/else 49 (73 pts), match/switch 7 (16 pts), boolean chains 14 (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.
D2 · Cognitive Complexity · AudioTranscriptionScreenKt.AudioTranscriptionScreen (cognitive 102) · ×1
  • AudioTranscriptionScreenKt.AudioTranscriptionScreen (cognitive 102) app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:69 — AudioTranscriptionScreenKt.AudioTranscriptionScreen has cognitive complexity 102 (threshold 15). Drivers by points: if/else 59 (68 pts), error handling 7 (18 pts), boolean chains 8, match/switch 4 (6 pts), loops 1 (2 pts) (nesting depth added 23). 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.
D2 · Cognitive Complexity · NotesManagerScreenKt.NotesManagerScreen (cognitive 101) · ×1
  • NotesManagerScreenKt.NotesManagerScreen (cognitive 101) app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:104 — NotesManagerScreenKt.NotesManagerScreen has cognitive complexity 101 (threshold 15). Drivers by points: if/else 61 (83 pts), boolean chains 12, error handling 2 (4 pts), match/switch 2 (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.
D2 · Cognitive Complexity · BundleItemBuilderKt.buildBundleItems (cognitive 100) · ×1
  • BundleItemBuilderKt.buildBundleItems (cognitive 100) app/src/main/java/com/example/llamadroid/ui/models/BundleItemBuilder.kt:87 — BundleItemBuilderKt.buildBundleItems has cognitive complexity 100 (threshold 15). Drivers by points: if/else 55 (78 pts), boolean chains 20, match/switch 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessScreenKt.NativeHarnessScreen (cognitive 99) · ×1
  • HarnessScreenKt.NativeHarnessScreen (cognitive 99) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:99 — HarnessScreenKt.NativeHarnessScreen has cognitive complexity 99 (threshold 15). Drivers by points: if/else 55 (66 pts), boolean chains 27, match/switch 5 (6 pts) (nesting depth added 12). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · WorkflowsScreenKt.MangaTranslationWorkflowContent (cognitive 98) · ×1
  • WorkflowsScreenKt.MangaTranslationWorkflowContent (cognitive 98) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1497 — WorkflowsScreenKt.MangaTranslationWorkflowContent has cognitive complexity 98 (threshold 15). Drivers by points: if/else 59 (83 pts), boolean chains 9, match/switch 2 (6 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TermuxScreenKt.TermuxScreen (cognitive 96) · ×1
  • TermuxScreenKt.TermuxScreen (cognitive 96) app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:64 — TermuxScreenKt.TermuxScreen has cognitive complexity 96 (threshold 15). Drivers by points: if/else 55 (77 pts), boolean chains 7, loops 5 (7 pts), match/switch 3, error handling 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentChatListKt.ChatMessageBubble (cognitive 95) · ×1
  • AgentChatListKt.ChatMessageBubble (cognitive 95) app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:863 — AgentChatListKt.ChatMessageBubble has cognitive complexity 95 (threshold 15). Drivers by points: if/else 57 (77 pts), boolean chains 10, match/switch 5 (8 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArcadeScreenKt.ArcadeScreen (cognitive 93) · ×1
  • ArcadeScreenKt.ArcadeScreen (cognitive 93) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:159 — ArcadeScreenKt.ArcadeScreen has cognitive complexity 93 (threshold 15). Drivers by points: if/else 53 (62 pts), boolean chains 14, error handling 8, match/switch 5 (7 pts), loops 2 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessOriginalWebViewKt.HarnessOriginalWebView (cognitive 90) · ×1
  • HarnessOriginalWebViewKt.HarnessOriginalWebView (cognitive 90) app/src/main/java/com/example/llamadroid/harness/HarnessOriginalWebView.kt:417 — HarnessOriginalWebViewKt.HarnessOriginalWebView has cognitive complexity 90 (threshold 15). Drivers by points: if/else 45 (65 pts), boolean chains 17, match/switch 3 (8 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdCliSupportKt.buildSdCommandArgs (cognitive 90) · ×1
  • SdCliSupportKt.buildSdCommandArgs (cognitive 90) app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt:193 — SdCliSupportKt.buildSdCommandArgs has cognitive complexity 90 (threshold 15). Drivers by points: if/else 51 (66 pts), boolean chains 20, match/switch 3 (4 pts) (nesting depth added 16). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessRuntimeTransferKt.HarnessRuntimeTransferDialog (cognitive 87) · ×1
  • HarnessRuntimeTransferKt.HarnessRuntimeTransferDialog (cognitive 87) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeTransfer.kt:168 — HarnessRuntimeTransferKt.HarnessRuntimeTransferDialog has cognitive complexity 87 (threshold 15). Drivers by points: if/else 33 (53 pts), boolean chains 29, match/switch 4 (5 pts) (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.
D2 · Cognitive Complexity · KiwixCatalogClient.parseOpdsXml (cognitive 84) · ×1
  • KiwixCatalogClient.parseOpdsXml (cognitive 84) app/src/main/java/com/example/llamadroid/data/model/KiwixCatalogClient.kt:85 — KiwixCatalogClient.parseOpdsXml has cognitive complexity 84 (threshold 15). Drivers by points: if/else 13 (55 pts), match/switch 4 (13 pts), loops 3 (11 pts), boolean chains 4, error handling 1 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeHarnessTurnActions.copyAssistantTurn (cognitive 84) · ×1
  • NativeHarnessTurnActions.copyAssistantTurn (cognitive 84) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnActions.kt:216 — NativeHarnessTurnActions.copyAssistantTurn has cognitive complexity 84 (threshold 15). Drivers by points: if/else 25 (74 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AudioLibraryScreenKt.AudioLibraryScreen (cognitive 84) · ×1
  • AudioLibraryScreenKt.AudioLibraryScreen (cognitive 84) app/src/main/java/com/example/llamadroid/ui/audio/library/AudioLibraryScreen.kt:110 — AudioLibraryScreenKt.AudioLibraryScreen has cognitive complexity 84 (threshold 15). Drivers by points: if/else 45 (52 pts), error handling 15 (23 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ModelManagerScreenKt.InstalledTab (cognitive 82) · ×1
  • ModelManagerScreenKt.InstalledTab (cognitive 82) app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:223 — ModelManagerScreenKt.InstalledTab has cognitive complexity 82 (threshold 15). Drivers by points: if/else 35 (55 pts), boolean chains 12, match/switch 4 (10 pts), error handling 3 (5 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoCommandBuilderKt.buildVideoCommandArgs (cognitive 81) · ×1
  • VideoCommandBuilderKt.buildVideoCommandArgs (cognitive 81) app/src/main/java/com/example/llamadroid/service/VideoCommandBuilder.kt:29 — VideoCommandBuilderKt.buildVideoCommandArgs has cognitive complexity 81 (threshold 15). Drivers by points: if/else 47 (58 pts), boolean chains 22, match/switch 1 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · VideoInterpolationScreenKt.VideoInterpolationScreen (cognitive 81) · ×1
  • VideoInterpolationScreenKt.VideoInterpolationScreen (cognitive 81) app/src/main/java/com/example/llamadroid/ui/ai/VideoInterpolationScreen.kt:119 — VideoInterpolationScreenKt.VideoInterpolationScreen has cognitive complexity 81 (threshold 15). Drivers by points: if/else 44 (69 pts), boolean chains 11, error handling 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessTerminalScreenUiKt.HarnessTerminalScreen (cognitive 80) · ×1
  • HarnessTerminalScreenUiKt.HarnessTerminalScreen (cognitive 80) app/src/main/java/com/example/llamadroid/harness/HarnessTerminalScreenUi.kt:149 — HarnessTerminalScreenUiKt.HarnessTerminalScreen has cognitive complexity 80 (threshold 15). Drivers by points: if/else 43 (56 pts), match/switch 7 (14 pts), boolean chains 10 (nesting depth added 20). 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.
D2 · Cognitive Complexity · TamaCanonicalActions.request (cognitive 78) · ×1
  • TamaCanonicalActions.request (cognitive 78) app/src/main/java/com/example/llamadroid/tama/game/TamaCanonicalActions.kt:28 — TamaCanonicalActions.request has cognitive complexity 78 (threshold 15). Drivers by points: if/else 31 (57 pts), boolean chains 15, match/switch 3 (4 pts), error handling 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.
D2 · Cognitive Complexity · VideoSumupScreenKt.VideoSumupScreen (cognitive 76) · ×1
  • VideoSumupScreenKt.VideoSumupScreen (cognitive 76) app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:72 — VideoSumupScreenKt.VideoSumupScreen has cognitive complexity 76 (threshold 15). Drivers by points: if/else 41 (60 pts), boolean chains 14, error handling 1, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeChatVideoSupportKt.prepareNativeChatVideoPayloads (cognitive 74) · ×1
  • NativeChatVideoSupportKt.prepareNativeChatVideoPayloads (cognitive 74) app/src/main/java/com/example/llamadroid/service/chat/NativeChatVideoSupport.kt:74 — NativeChatVideoSupportKt.prepareNativeChatVideoPayloads has cognitive complexity 74 (threshold 15). Drivers by points: if/else 27 (46 pts), boolean chains 14, error handling 5 (13 pts), match/switch 1 (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.
D2 · Cognitive Complexity · AgentDialogsKt.AgentGlobalOverrideCard (cognitive 74) · ×1
  • AgentDialogsKt.AgentGlobalOverrideCard (cognitive 74) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2695 — AgentDialogsKt.AgentGlobalOverrideCard has cognitive complexity 74 (threshold 15). Drivers by points: if/else 54 (63 pts), match/switch 5 (7 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MangaPaintedMaskEditorKt.PaintedMaskEditorContent (cognitive 74) · ×1
  • MangaPaintedMaskEditorKt.PaintedMaskEditorContent (cognitive 74) app/src/main/java/com/example/llamadroid/ui/ai/MangaPaintedMaskEditor.kt:223 — MangaPaintedMaskEditorKt.PaintedMaskEditorContent has cognitive complexity 74 (threshold 15). Drivers by points: if/else 31 (45 pts), match/switch 6 (14 pts), boolean chains 13, loops 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaClientService.streamNativeToolResponse (cognitive 73) · ×1
  • LlamaClientService.streamNativeToolResponse (cognitive 73) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1908 — LlamaClientService.streamNativeToolResponse has cognitive complexity 73 (threshold 15). Drivers by points: if/else 47 (56 pts), boolean chains 13, error handling 3, loops 1 (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.
D2 · Cognitive Complexity · PDFService.recognizeBitmapWithLlamaOcr (cognitive 72) · ×1
  • PDFService.recognizeBitmapWithLlamaOcr (cognitive 72) app/src/main/java/com/example/llamadroid/service/PDFService.kt:3461 — PDFService.recognizeBitmapWithLlamaOcr has cognitive complexity 72 (threshold 15). Drivers by points: if/else 35 (63 pts), boolean chains 6, error handling 2, match/switch 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeChatToolRuntime.executeToolCall (cognitive 71) · ×1
  • NativeChatToolRuntime.executeToolCall (cognitive 71) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:1507 — NativeChatToolRuntime.executeToolCall has cognitive complexity 71 (threshold 15). Drivers by points: boolean chains 43, if/else 17 (24 pts), error handling 2, match/switch 2 (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AgentService.getAgentTools (cognitive 70) · ×1
  • AgentService.getAgentTools (cognitive 70) app/src/main/java/com/example/llamadroid/service/AgentService.kt:17281 — AgentService.getAgentTools has cognitive complexity 70 (threshold 15). Drivers by points: if/else 38 (52 pts), boolean chains 16, error handling 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatMessageItemKt.LlamaMessageItem (cognitive 68) · ×1
  • ChatMessageItemKt.LlamaMessageItem (cognitive 68) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageItem.kt:110 — ChatMessageItemKt.LlamaMessageItem has cognitive complexity 68 (threshold 15). Drivers by points: if/else 39 (57 pts), boolean chains 10, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaClientService.startGeneration (cognitive 66) · ×1
  • LlamaClientService.startGeneration (cognitive 66) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:412 — LlamaClientService.startGeneration has cognitive complexity 66 (threshold 15). Drivers by points: if/else 35 (45 pts), boolean chains 19, error handling 2 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LlamaChatListScreenKt.LlamaChatListContent (cognitive 66) · ×1
  • LlamaChatListScreenKt.LlamaChatListContent (cognitive 66) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaChatListScreen.kt:91 — LlamaChatListScreenKt.LlamaChatListContent has cognitive complexity 66 (threshold 15). Drivers by points: if/else 42 (59 pts), match/switch 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoteSummaryBackendEditorKt.RemoteSummaryBackendEditor (cognitive 66) · ×1
  • RemoteSummaryBackendEditorKt.RemoteSummaryBackendEditor (cognitive 66) app/src/main/java/com/example/llamadroid/ui/components/RemoteSummaryBackendEditor.kt:75 — RemoteSummaryBackendEditorKt.RemoteSummaryBackendEditor has cognitive complexity 66 (threshold 15). Drivers by points: if/else 38 (50 pts), boolean chains 8, match/switch 5 (8 pts) (nesting depth added 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ProcessController.start (cognitive 65) · ×1
  • ProcessController.start (cognitive 65) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:965 — ProcessController.start has cognitive complexity 65 (threshold 15). Drivers by points: if/else 38 (54 pts), boolean chains 7, loops 2 (3 pts), error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FarmDroneDataKt.runPlantingDroneTick (cognitive 65) · ×1
  • FarmDroneDataKt.runPlantingDroneTick (cognitive 65) app/src/main/java/com/example/llamadroid/tama/data/FarmDroneData.kt:265 — FarmDroneDataKt.runPlantingDroneTick has cognitive complexity 65 (threshold 15). Drivers by points: if/else 30 (46 pts), boolean chains 13, match/switch 2 (4 pts), loops 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TamaChatScreenKt.TamaChatBubble (cognitive 65) · ×1
  • TamaChatScreenKt.TamaChatBubble (cognitive 65) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:773 — TamaChatScreenKt.TamaChatBubble has cognitive complexity 65 (threshold 15). Drivers by points: if/else 42 (53 pts), boolean chains 8, match/switch 2 (4 pts) (nesting depth added 13). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TamaNotificationReceiver.handleAlarm (cognitive 64) · ×1
  • TamaNotificationReceiver.handleAlarm (cognitive 64) app/src/main/java/com/example/llamadroid/tama/notifications/TamaNotificationReceiver.kt:50 — TamaNotificationReceiver.handleAlarm has cognitive complexity 64 (threshold 15). Drivers by points: if/else 31 (55 pts), boolean chains 8, match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelSourceRepository.startBundleDownloadQueue (cognitive 63) · ×1
  • ModelSourceRepository.startBundleDownloadQueue (cognitive 63) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1351 — ModelSourceRepository.startBundleDownloadQueue has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (45 pts), boolean chains 17, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessRuntimeController.runStart (cognitive 63) · ×1
  • HarnessRuntimeController.runStart (cognitive 63) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:375 — HarnessRuntimeController.runStart has cognitive complexity 63 (threshold 15). Drivers by points: if/else 34 (59 pts), boolean chains 3, error handling 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OllamaService.performChatWithToolsStreaming (cognitive 63) · ×1
  • OllamaService.performChatWithToolsStreaming (cognitive 63) app/src/main/java/com/example/llamadroid/service/OllamaService.kt:535 — OllamaService.performChatWithToolsStreaming has cognitive complexity 63 (threshold 15). Drivers by points: if/else 17 (53 pts), loops 3 (7 pts), error handling 1 (2 pts), boolean chains 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.
D2 · Cognitive Complexity · AdventureGateCombatEngine.resolveSpeedRound (cognitive 63) · ×1
  • AdventureGateCombatEngine.resolveSpeedRound (cognitive 63) app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateCombatEngine.kt:349 — AdventureGateCombatEngine.resolveSpeedRound has cognitive complexity 63 (threshold 15). Drivers by points: if/else 23 (45 pts), match/switch 4 (12 pts), boolean chains 5, loops 1 (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.
D2 · Cognitive Complexity · LegacyUpscaleScreenKt.LegacyUpscaleScreen (cognitive 63) · ×1
  • LegacyUpscaleScreenKt.LegacyUpscaleScreen (cognitive 63) app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:113 — LegacyUpscaleScreenKt.LegacyUpscaleScreen has cognitive complexity 63 (threshold 15). Drivers by points: if/else 34 (55 pts), boolean chains 7, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeneralSettingsScreenKt.GeneralSettingsScreen (cognitive 62) · ×1
  • GeneralSettingsScreenKt.GeneralSettingsScreen (cognitive 62) app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:73 — GeneralSettingsScreenKt.GeneralSettingsScreen has cognitive complexity 62 (threshold 15). Drivers by points: if/else 41 (45 pts), boolean chains 15, match/switch 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NativeHarnessPluginActions.install (cognitive 61) · ×1
  • NativeHarnessPluginActions.install (cognitive 61) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessPluginActions.kt:71 — NativeHarnessPluginActions.install has cognitive complexity 61 (threshold 15). Drivers by points: if/else 33 (51 pts), boolean chains 5, match/switch 2 (5 pts) (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.
D2 · Cognitive Complexity · app.renderChatControls (cognitive 61) · ×1
  • app.renderChatControls (cognitive 61) app/src/main/assets/ai_servers_webui/app.js:868 — app.renderChatControls has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 31 (35 pts), boolean chains 26 (nesting depth added 4). Of this number, 55 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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.
D2 · Cognitive Complexity · MusicWorkspaceKt.MusicWorkspace (cognitive 60) · ×1
  • MusicWorkspaceKt.MusicWorkspace (cognitive 60) app/src/main/java/com/example/llamadroid/ui/audio/music/MusicWorkspace.kt:28 — MusicWorkspaceKt.MusicWorkspace has cognitive complexity 60 (threshold 15). Drivers by points: if/else 30 (42 pts), boolean chains 12, match/switch 3 (6 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.
D2 · Cognitive Complexity · VideoRecognitionSummaryService.run (cognitive 59) · ×1
  • VideoRecognitionSummaryService.run (cognitive 59) app/src/main/java/com/example/llamadroid/service/VideoRecognitionSummaryService.kt:666 — VideoRecognitionSummaryService.run has cognitive complexity 59 (threshold 15). Drivers by points: if/else 31 (41 pts), boolean chains 13, error handling 3, loops 1, match/switch 1 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TermuxFileManagerScreenKt.TermuxFileManagerScreen (cognitive 58) · ×1
  • TermuxFileManagerScreenKt.TermuxFileManagerScreen (cognitive 58) app/src/main/java/com/example/llamadroid/ui/ai/TermuxFileManagerScreen.kt:98 — TermuxFileManagerScreenKt.TermuxFileManagerScreen has cognitive complexity 58 (threshold 15). Drivers by points: if/else 39 (46 pts), boolean chains 8, loops 2, error handling 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.
D2 · Cognitive Complexity · ModelArtifactRecognizer.inspect (cognitive 57) · ×1
  • ModelArtifactRecognizer.inspect (cognitive 57) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:48 — ModelArtifactRecognizer.inspect has cognitive complexity 57 (threshold 15). Drivers by points: if/else 31 (52 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFSummaryScreenKt.PDFSummaryScreen (cognitive 57) · ×1
  • PDFSummaryScreenKt.PDFSummaryScreen (cognitive 57) app/src/main/java/com/example/llamadroid/ui/pdf/PDFSummaryScreen.kt:74 — PDFSummaryScreenKt.PDFSummaryScreen has cognitive complexity 57 (threshold 15). Drivers by points: if/else 29 (42 pts), boolean chains 9, match/switch 5, 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.
D2 · Cognitive Complexity · WorldFarmMaintenance.complete (cognitive 56) · ×1
  • WorldFarmMaintenance.complete (cognitive 56) app/src/main/java/com/example/llamadroid/tama/game/WorldFarmMaintenance.kt:33 — WorldFarmMaintenance.complete has cognitive complexity 56 (threshold 15). Drivers by points: if/else 32 (43 pts), boolean chains 8, match/switch 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowsScreenKt.Txt2ImgUpscaleWorkflowContent (cognitive 56) · ×1
  • WorkflowsScreenKt.Txt2ImgUpscaleWorkflowContent (cognitive 56) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5833 — WorkflowsScreenKt.Txt2ImgUpscaleWorkflowContent has cognitive complexity 56 (threshold 15). Drivers by points: if/else 31 (40 pts), match/switch 4 (7 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 14). 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.
D2 · Cognitive Complexity · SdArtifactInspector.classifyEvidence (cognitive 55) · ×1
  • SdArtifactInspector.classifyEvidence (cognitive 55) app/src/main/java/com/example/llamadroid/sd/SdArtifactInspector.kt:608 — SdArtifactInspector.classifyEvidence has cognitive complexity 55 (threshold 15). Drivers by points: boolean chains 41, if/else 7, match/switch 7. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LlamaClientService.streamLlamaServerResponse (cognitive 55) · ×1
  • LlamaClientService.streamLlamaServerResponse (cognitive 55) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:1344 — LlamaClientService.streamLlamaServerResponse has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (37 pts), error handling 5 (9 pts), boolean chains 8, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeHarnessController.selectModel (cognitive 54) · ×1
  • NativeHarnessController.selectModel (cognitive 54) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1406 — NativeHarnessController.selectModel has cognitive complexity 54 (threshold 15). Drivers by points: if/else 27 (42 pts), boolean chains 7, error handling 2 (4 pts), 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.
D2 · Cognitive Complexity · NativeHarnessSettingsSchemaKt.normalizeHarnessSettingsSchema (cognitive 54) · ×1
  • NativeHarnessSettingsSchemaKt.normalizeHarnessSettingsSchema (cognitive 54) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessSettingsSchema.kt:22 — NativeHarnessSettingsSchemaKt.normalizeHarnessSettingsSchema has cognitive complexity 54 (threshold 15). Drivers by points: if/else 27 (36 pts), boolean chains 14, match/switch 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdventureGateScreenKt.AdventureGateScreen (cognitive 53) · ×1
  • AdventureGateScreenKt.AdventureGateScreen (cognitive 53) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:163 — AdventureGateScreenKt.AdventureGateScreen has cognitive complexity 53 (threshold 15). Drivers by points: if/else 27 (34 pts), boolean chains 15, loops 2, match/switch 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TamaChatScreenKt.TamaChatScreen (cognitive 53) · ×1
  • TamaChatScreenKt.TamaChatScreen (cognitive 53) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:90 — TamaChatScreenKt.TamaChatScreen has cognitive complexity 53 (threshold 15). Drivers by points: if/else 38 (39 pts), boolean chains 10, error handling 2, loops 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NativeChatToolAwarenessMessagesKt.nativeChatToolAwarenessMessages (cognitive 52) · ×1
  • NativeChatToolAwarenessMessagesKt.nativeChatToolAwarenessMessages (cognitive 52) app/src/main/java/com/example/llamadroid/service/chat/NativeChatToolAwarenessMessages.kt:10 — NativeChatToolAwarenessMessagesKt.nativeChatToolAwarenessMessages has cognitive complexity 52 (threshold 15). Drivers by points: if/else 28 (39 pts), boolean chains 7, match/switch 3 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FarmScreenKt.FarmScreen (cognitive 52) · ×1
  • FarmScreenKt.FarmScreen (cognitive 52) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmScreen.kt:78 — FarmScreenKt.FarmScreen has cognitive complexity 52 (threshold 15). Drivers by points: if/else 31 (37 pts), boolean chains 11, loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FastsdGalleryScreenKt.FastsdGalleryScreen (cognitive 52) · ×1
  • FastsdGalleryScreenKt.FastsdGalleryScreen (cognitive 52) app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:74 — FastsdGalleryScreenKt.FastsdGalleryScreen has cognitive complexity 52 (threshold 15). Drivers by points: if/else 26 (36 pts), error handling 8 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OnnxBackgroundRemovalScreenKt.OnnxBackgroundRemovalScreen (cognitive 52) · ×1
  • OnnxBackgroundRemovalScreenKt.OnnxBackgroundRemovalScreen (cognitive 52) app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:127 — OnnxBackgroundRemovalScreenKt.OnnxBackgroundRemovalScreen has cognitive complexity 52 (threshold 15). Drivers by points: if/else 23 (36 pts), match/switch 4 (11 pts), boolean chains 4, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdventureScreenKt.AdventureScreen (cognitive 51) · ×1
  • AdventureScreenKt.AdventureScreen (cognitive 51) app/src/main/java/com/example/llamadroid/tama/ui/AdventureScreen.kt:95 — AdventureScreenKt.AdventureScreen has cognitive complexity 51 (threshold 15). Drivers by points: if/else 28 (38 pts), boolean chains 12, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentWorkspaceScreenKt.WorkspaceTerminalDialog (cognitive 51) · ×1
  • AgentWorkspaceScreenKt.WorkspaceTerminalDialog (cognitive 51) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:1780 — AgentWorkspaceScreenKt.WorkspaceTerminalDialog has cognitive complexity 51 (threshold 15). Drivers by points: if/else 37 (41 pts), boolean chains 5, match/switch 5 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessInlineLinksKt.harnessInlineLinks (cognitive 51) · ×1
  • HarnessInlineLinksKt.harnessInlineLinks (cognitive 51) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessInlineLinks.kt:64 — HarnessInlineLinksKt.harnessInlineLinks has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 8, loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProcessController.getCommand (cognitive 50) · ×1
  • ProcessController.getCommand (cognitive 50) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:146 — ProcessController.getCommand has cognitive complexity 50 (threshold 15). Drivers by points: if/else 33 (42 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VideoSumupService.summarizeVideo (cognitive 50) · ×1
  • VideoSumupService.summarizeVideo (cognitive 50) app/src/main/java/com/example/llamadroid/service/VideoSumupService.kt:196 — VideoSumupService.summarizeVideo has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (32 pts), error handling 5 (11 pts), match/switch 1 (5 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuadtrixCommandBuilder.trainingArgs (cognitive 49) · ×1
  • QuadtrixCommandBuilder.trainingArgs (cognitive 49) app/src/main/java/com/example/llamadroid/quadtrix/QuadtrixRuntime.kt:179 — QuadtrixCommandBuilder.trainingArgs has cognitive complexity 49 (threshold 15). Drivers by points: if/else 27 (38 pts), boolean chains 11 (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.
D2 · Cognitive Complexity · HarnessProjectActionDialogKt.HarnessProjectActionDialog (cognitive 49) · ×1
  • HarnessProjectActionDialogKt.HarnessProjectActionDialog (cognitive 49) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:81 — HarnessProjectActionDialogKt.HarnessProjectActionDialog has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (30 pts), boolean chains 12, match/switch 3 (5 pts), error handling 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MainActivityKt.PetScreen (cognitive 49) · ×1
  • MainActivityKt.PetScreen (cognitive 49) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2077 — MainActivityKt.PetScreen has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (47 pts), boolean chains 2 (nesting depth added 29). 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.
D2 · Cognitive Complexity · LlamaAppKt.LlamaApp (cognitive 48) · ×1
  • LlamaAppKt.LlamaApp (cognitive 48) app/src/main/java/com/example/llamadroid/ui/LlamaApp.kt:192 — LlamaAppKt.LlamaApp has cognitive complexity 48 (threshold 15). Drivers by points: if/else 27 (30 pts), boolean chains 10, error handling 2 (5 pts), match/switch 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NativeHarnessSchemaKt.parseHarnessSchemaFields (cognitive 48) · ×1
  • NativeHarnessSchemaKt.parseHarnessSchemaFields (cognitive 48) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessSchema.kt:107 — NativeHarnessSchemaKt.parseHarnessSchemaFields has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (27 pts), match/switch 5 (13 pts), boolean chains 8 (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.
D2 · Cognitive Complexity · ModelArtifactFinalizer.finalizePrepared (cognitive 47) · ×1
  • ModelArtifactFinalizer.finalizePrepared (cognitive 47) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactFinalizer.kt:228 — ModelArtifactFinalizer.finalizePrepared has cognitive complexity 47 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 16, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TamaScreenKt.TamaPetDisplay (cognitive 47) · ×1
  • TamaScreenKt.TamaPetDisplay (cognitive 47) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4784 — TamaScreenKt.TamaPetDisplay has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (26 pts), boolean chains 13, match/switch 5 (8 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VideoUpscalerScreenKt.VideoUpscalerScreen (cognitive 47) · ×1
  • VideoUpscalerScreenKt.VideoUpscalerScreen (cognitive 47) app/src/main/java/com/example/llamadroid/ui/ai/VideoUpscalerScreen.kt:46 — VideoUpscalerScreenKt.VideoUpscalerScreen has cognitive complexity 47 (threshold 15). Drivers by points: if/else 31 (33 pts), boolean chains 10, error handling 1 (2 pts), match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessBridgeOperations.invoke (cognitive 46) · ×1
  • HarnessBridgeOperations.invoke (cognitive 46) app/src/main/java/com/example/llamadroid/harness/HarnessBridgeOperations.kt:104 — HarnessBridgeOperations.invoke has cognitive complexity 46 (threshold 15). Drivers by points: if/else 28 (33 pts), match/switch 4 (6 pts), boolean chains 4, error handling 2 (3 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.
D2 · Cognitive Complexity · HarnessTermuxTransportViewKt.harnessTermuxKeySequence (cognitive 46) · ×1
  • HarnessTermuxTransportViewKt.harnessTermuxKeySequence (cognitive 46) app/src/main/java/com/example/llamadroid/harness/HarnessTermuxTransportView.kt:656 — HarnessTermuxTransportViewKt.harnessTermuxKeySequence has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (31 pts), boolean chains 6, match/switch 4 (6 pts), loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MangaPaintedOcrSupport.analyzeMask (cognitive 46) · ×1
  • MangaPaintedOcrSupport.analyzeMask (cognitive 46) app/src/main/java/com/example/llamadroid/service/MangaPaintedOcrSupport.kt:191 — MangaPaintedOcrSupport.analyzeMask has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 4 (10 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · HarnessComposerKt.HarnessComposer (cognitive 46) · ×1
  • HarnessComposerKt.HarnessComposer (cognitive 46) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessComposer.kt:264 — HarnessComposerKt.HarnessComposer has cognitive complexity 46 (threshold 15). Drivers by points: if/else 28 (33 pts), boolean chains 11, match/switch 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NativeHarnessTurnDetailsKt.projectNativeHarnessTurnUsage (cognitive 46) · ×1
  • NativeHarnessTurnDetailsKt.projectNativeHarnessTurnUsage (cognitive 46) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetails.kt:601 — NativeHarnessTurnDetailsKt.projectNativeHarnessTurnUsage has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 12, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KnowledgeBaseScreenKt.KnowledgeBaseScreen (cognitive 46) · ×1
  • KnowledgeBaseScreenKt.KnowledgeBaseScreen (cognitive 46) app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:122 — KnowledgeBaseScreenKt.KnowledgeBaseScreen has cognitive complexity 46 (threshold 15). Drivers by points: if/else 28 (41 pts), boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelRepository.updateModel (cognitive 45) · ×1
  • ModelRepository.updateModel (cognitive 45) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1398 — ModelRepository.updateModel has cognitive complexity 45 (threshold 15). Drivers by points: if/else 26 (35 pts), boolean chains 5, error handling 3 (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.
D2 · Cognitive Complexity · LlamaStreamingTextAccumulator.drainPending (cognitive 45) · ×1
  • LlamaStreamingTextAccumulator.drainPending (cognitive 45) app/src/main/java/com/example/llamadroid/service/LlamaStreamingTextAccumulator.kt:97 — LlamaStreamingTextAccumulator.drainPending has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (42 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFToolboxScreenKt.GuidedPdfOcrTool (cognitive 45) · ×1
  • PDFToolboxScreenKt.GuidedPdfOcrTool (cognitive 45) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1493 — PDFToolboxScreenKt.GuidedPdfOcrTool has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 10, match/switch 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelegateSubagentLoop.mainLoop (cognitive 44) · ×1
  • DelegateSubagentLoop.mainLoop (cognitive 44) app/src/main/java/com/example/llamadroid/service/delegation/DelegateSubagentLoop.kt:219 — DelegateSubagentLoop.mainLoop has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 2 (6 pts), error handling 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerProfileEditorScreenKt.ServerProfileEditorScreen (cognitive 44) · ×1
  • ServerProfileEditorScreenKt.ServerProfileEditorScreen (cognitive 44) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/ServerProfileEditorScreen.kt:93 — ServerProfileEditorScreenKt.ServerProfileEditorScreen has cognitive complexity 44 (threshold 15). Drivers by points: if/else 32 (34 pts), boolean chains 10 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OllamaManagerScreenKt.OllamaManagerScreen (cognitive 44) · ×1
  • OllamaManagerScreenKt.OllamaManagerScreen (cognitive 44) app/src/main/java/com/example/llamadroid/ui/ai/ollama/OllamaManagerScreen.kt:62 — OllamaManagerScreenKt.OllamaManagerScreen has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 8, match/switch 3 (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.
D2 · Cognitive Complexity · BenchmarkScreenKt.BenchmarkScreen (cognitive 44) · ×1
  • BenchmarkScreenKt.BenchmarkScreen (cognitive 44) app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkScreen.kt:42 — BenchmarkScreenKt.BenchmarkScreen has cognitive complexity 44 (threshold 15). Drivers by points: if/else 29 (38 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · AgentDirectRuntimeSupportKt.advanceDirectAgentState (cognitive 43) · ×1
  • AgentDirectRuntimeSupportKt.advanceDirectAgentState (cognitive 43) app/src/main/java/com/example/llamadroid/service/AgentDirectRuntimeSupport.kt:42 — AgentDirectRuntimeSupportKt.advanceDirectAgentState has cognitive complexity 43 (threshold 15). Drivers by points: if/else 26 (39 pts), boolean chains 3, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AgentProjectControlPlane.permittedNextActions (cognitive 43) · ×1
  • AgentProjectControlPlane.permittedNextActions (cognitive 43) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:3209 — AgentProjectControlPlane.permittedNextActions has cognitive complexity 43 (threshold 15). Drivers by points: if/else 28 (41 pts), boolean chains 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeHarnessTurnDetailsKt.mergeNativeHarnessTurnDetails (cognitive 43) · ×1
  • NativeHarnessTurnDetailsKt.mergeNativeHarnessTurnDetails (cognitive 43) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetails.kt:218 — NativeHarnessTurnDetailsKt.mergeNativeHarnessTurnDetails has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 11 (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.
D2 · Cognitive Complexity · DatasetProjectScreenKt.ReviewTab (cognitive 43) · ×1
  • DatasetProjectScreenKt.ReviewTab (cognitive 43) app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:1323 — DatasetProjectScreenKt.ReviewTab has cognitive complexity 43 (threshold 15). Drivers by points: if/else 30 (31 pts), boolean chains 8, match/switch 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DatasetProjectScreenKt.SettingsTab (cognitive 43) · ×1
  • DatasetProjectScreenKt.SettingsTab (cognitive 43) app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:1873 — DatasetProjectScreenKt.SettingsTab has cognitive complexity 43 (threshold 15). Drivers by points: if/else 30 (35 pts), boolean chains 5, match/switch 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LiteRtTextGenerationClient.streamSafely (cognitive 42) · ×1
  • LiteRtTextGenerationClient.streamSafely (cognitive 42) app/src/main/java/com/example/llamadroid/service/LiteRtTextGenerationClient.kt:153 — LiteRtTextGenerationClient.streamSafely has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (28 pts), error handling 4 (12 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · ProcessControllerKt.resolveManagedLlamaCustomFlags (cognitive 42) · ×1
  • ProcessControllerKt.resolveManagedLlamaCustomFlags (cognitive 42) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:1503 — ProcessControllerKt.resolveManagedLlamaCustomFlags has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhisperService.transcribe (cognitive 42) · ×1
  • WhisperService.transcribe (cognitive 42) app/src/main/java/com/example/llamadroid/service/WhisperService.kt:139 — WhisperService.transcribe has cognitive complexity 42 (threshold 15). Drivers by points: if/else 25 (31 pts), error handling 6, match/switch 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SubtitleBurnScreenKt.SubtitleBurnScreen (cognitive 42) · ×1
  • SubtitleBurnScreenKt.SubtitleBurnScreen (cognitive 42) app/src/main/java/com/example/llamadroid/ui/ai/SubtitleBurnScreen.kt:71 — SubtitleBurnScreenKt.SubtitleBurnScreen has cognitive complexity 42 (threshold 15). Drivers by points: if/else 31 (34 pts), boolean chains 4, error handling 3, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OllamaManagerScreenKt.ModelList (cognitive 42) · ×1
  • OllamaManagerScreenKt.ModelList (cognitive 42) app/src/main/java/com/example/llamadroid/ui/ai/ollama/OllamaManagerScreen.kt:568 — OllamaManagerScreenKt.ModelList has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolHttpServer.generateWebChatReply (cognitive 41) · ×1
  • ToolHttpServer.generateWebChatReply (cognitive 41) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:3075 — ToolHttpServer.generateWebChatReply has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 6, error handling 2, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLlamaServerCoordinator.prepare (cognitive 41) · ×1
  • ManagedLlamaServerCoordinator.prepare (cognitive 41) app/src/main/java/com/example/llamadroid/service/ManagedLlamaServerCoordinator.kt:96 — ManagedLlamaServerCoordinator.prepare has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 8, error handling 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkerModeScreenKt.WorkerModeScreen (cognitive 41) · ×1
  • WorkerModeScreenKt.WorkerModeScreen (cognitive 41) app/src/main/java/com/example/llamadroid/ui/distributed/WorkerModeScreen.kt:75 — WorkerModeScreenKt.WorkerModeScreen has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 4, match/switch 2, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZimManagerScreenKt.ZimShareTab (cognitive 41) · ×1
  • ZimManagerScreenKt.ZimShareTab (cognitive 41) app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:1079 — ZimManagerScreenKt.ZimShareTab has cognitive complexity 41 (threshold 15). Drivers by points: if/else 26 (30 pts), loops 2 (5 pts), boolean chains 3, error handling 1 (2 pts), match/switch 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.
D2 · Cognitive Complexity · RemoteMasterServer.handleClient (cognitive 40) · ×1
  • RemoteMasterServer.handleClient (cognitive 40) app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:116 — RemoteMasterServer.handleClient has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 18, if/else 10 (15 pts), error handling 2 (3 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TamaChatServerSettingsKt.TamaChatSettingsDialog (cognitive 40) · ×1
  • TamaChatServerSettingsKt.TamaChatSettingsDialog (cognitive 40) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatServerSettings.kt:82 — TamaChatServerSettingsKt.TamaChatSettingsDialog has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (29 pts), match/switch 3 (9 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeHarnessController.applyFollowFrame (cognitive 40) · ×1
  • NativeHarnessController.applyFollowFrame (cognitive 40) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:2053 — NativeHarnessController.applyFollowFrame has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeHarnessSettingsReader.readSettings (cognitive 40) · ×1
  • NativeHarnessSettingsReader.readSettings (cognitive 40) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessSettingsReader.kt:54 — NativeHarnessSettingsReader.readSettings has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 3 (6 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 19). 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.
D2 · Cognitive Complexity · ModelLibraryScreenKt.BundleEditorDialog (cognitive 40) · ×1
  • ModelLibraryScreenKt.BundleEditorDialog (cognitive 40) app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryScreen.kt:1393 — ModelLibraryScreenKt.BundleEditorDialog has cognitive complexity 40 (threshold 15). Drivers by points: if/else 24 (33 pts), boolean chains 6, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdArtifactInspector.inspectSafeTensors (cognitive 39) · ×1
  • SdArtifactInspector.inspectSafeTensors (cognitive 39) app/src/main/java/com/example/llamadroid/sd/SdArtifactInspector.kt:189 — SdArtifactInspector.inspectSafeTensors has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 5, error handling 1, loops 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.
D2 · Cognitive Complexity · BenchmarkService.runBenchmark (cognitive 39) · ×1
  • BenchmarkService.runBenchmark (cognitive 39) app/src/main/java/com/example/llamadroid/service/BenchmarkService.kt:218 — BenchmarkService.runBenchmark has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 2 (8 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TamaAgentService.generateAssistantReply (cognitive 39) · ×1
  • TamaAgentService.generateAssistantReply (cognitive 39) app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:408 — TamaAgentService.generateAssistantReply has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelRepository.deleteModelArtifactsInternal (cognitive 38) · ×1
  • ModelRepository.deleteModelArtifactsInternal (cognitive 38) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1060 — ModelRepository.deleteModelArtifactsInternal has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 12, error handling 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentRuntimeDispatchResolver.resolve (cognitive 38) · ×1
  • AgentRuntimeDispatchResolver.resolve (cognitive 38) app/src/main/java/com/example/llamadroid/data/runtime/AgentRuntimeProfileSupport.kt:517 — AgentRuntimeDispatchResolver.resolve has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 12, match/switch 4 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeChatToolRuntime.fetchUrlText (cognitive 38) · ×1
  • NativeChatToolRuntime.fetchUrlText (cognitive 38) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:2450 — NativeChatToolRuntime.fetchUrlText has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFService.readJpegDimensions (cognitive 38) · ×1
  • PDFService.readJpegDimensions (cognitive 38) app/src/main/java/com/example/llamadroid/service/PDFService.kt:6848 — PDFService.readJpegDimensions has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 4 (6 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · SSHService.uploadToRemotePath (cognitive 38) · ×1
  • SSHService.uploadToRemotePath (cognitive 38) app/src/main/java/com/example/llamadroid/service/SSHService.kt:447 — SSHService.uploadToRemotePath has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 4 (6 pts), boolean chains 4, error handling 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeHarnessSettingsReader.readModelCatalog (cognitive 38) · ×1
  • NativeHarnessSettingsReader.readModelCatalog (cognitive 38) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessSettingsReader.kt:188 — NativeHarnessSettingsReader.readModelCatalog has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (28 pts), error handling 3 (5 pts), boolean chains 4, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownTextKt.buildInlineAnnotated (cognitive 38) · ×1
  • MarkdownTextKt.buildInlineAnnotated (cognitive 38) app/src/main/java/com/example/llamadroid/ui/ai/llama/MarkdownText.kt:637 — MarkdownTextKt.buildInlineAnnotated has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 7, match/switch 1 (2 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.
D2 · Cognitive Complexity · ZimManagerScreenKt.InstalledZimsTab (cognitive 38) · ×1
  • ZimManagerScreenKt.InstalledZimsTab (cognitive 38) app/src/main/java/com/example/llamadroid/ui/kiwix/ZimManagerScreen.kt:182 — ZimManagerScreenKt.InstalledZimsTab has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (28 pts), error handling 5 (6 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · LiteRtModelsScreenKt.LiteRtModelsScreen (cognitive 38) · ×1
  • LiteRtModelsScreenKt.LiteRtModelsScreen (cognitive 38) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:160 — LiteRtModelsScreenKt.LiteRtModelsScreen has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 10, error handling 2, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OnnxModelsScreenKt.OnnxModelsScreen (cognitive 38) · ×1
  • OnnxModelsScreenKt.OnnxModelsScreen (cognitive 38) app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:154 — OnnxModelsScreenKt.OnnxModelsScreen has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 5, match/switch 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · WalkthroughStateKt.tourTarget (cognitive 38) · ×1
  • WalkthroughStateKt.tourTarget (cognitive 38) app/src/main/java/com/example/llamadroid/ui/walkthrough/WalkthroughState.kt:208 — WalkthroughStateKt.tourTarget has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (34 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdWorkflowGateKt.evaluateSdWorkflowGate (cognitive 37) · ×1
  • SdWorkflowGateKt.evaluateSdWorkflowGate (cognitive 37) app/src/main/java/com/example/llamadroid/data/model/SdWorkflowGate.kt:63 — SdWorkflowGateKt.evaluateSdWorkflowGate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 14, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ProcessControllerKt.migrateLegacyLlamaManagedSettings (cognitive 37) · ×1
  • ProcessControllerKt.migrateLegacyLlamaManagedSettings (cognitive 37) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:1666 — ProcessControllerKt.migrateLegacyLlamaManagedSettings has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 4, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TamaGameEngine.updateForTimePassedLocked (cognitive 37) · ×1
  • TamaGameEngine.updateForTimePassedLocked (cognitive 37) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:315 — TamaGameEngine.updateForTimePassedLocked has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdventureGateCombatEngine.applyEnemyAction (cognitive 37) · ×1
  • AdventureGateCombatEngine.applyEnemyAction (cognitive 37) app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateCombatEngine.kt:1060 — AdventureGateCombatEngine.applyEnemyAction has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27 (31 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ImageGenModeSupportKt.resolveImageGenReadiness (cognitive 37) · ×1
  • ImageGenModeSupportKt.resolveImageGenReadiness (cognitive 37) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenModeSupport.kt:79 — ImageGenModeSupportKt.resolveImageGenReadiness has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (36 pts), 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.
D2 · Cognitive Complexity · WorkflowsScreenKt.WorkflowOutputGalleryCard (cognitive 37) · ×1
  • WorkflowsScreenKt.WorkflowOutputGalleryCard (cognitive 37) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3186 — WorkflowsScreenKt.WorkflowOutputGalleryCard has cognitive complexity 37 (threshold 15). Drivers by points: if/else 24 (33 pts), match/switch 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowsScreenKt.TranscribeSummaryWorkflowContent (cognitive 37) · ×1
  • WorkflowsScreenKt.TranscribeSummaryWorkflowContent (cognitive 37) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6884 — WorkflowsScreenKt.TranscribeSummaryWorkflowContent has cognitive complexity 37 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 4, error handling 2 (3 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessImageParts.rewrite (cognitive 36) · ×1
  • HarnessImageParts.rewrite (cognitive 36) app/src/main/java/com/example/llamadroid/harness/HarnessImageParts.kt:44 — HarnessImageParts.rewrite has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (27 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (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.
D2 · Cognitive Complexity · AgentRuntimeSupportKt.sanitizeTerminalTranscript (cognitive 36) · ×1
  • AgentRuntimeSupportKt.sanitizeTerminalTranscript (cognitive 36) app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:915 — AgentRuntimeSupportKt.sanitizeTerminalTranscript has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 3 (7 pts), boolean chains 6, loops 3 (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.
D2 · Cognitive Complexity · HarnessSettingsNavigationKt.HarnessSettingsNavigator (cognitive 36) · ×1
  • HarnessSettingsNavigationKt.HarnessSettingsNavigator (cognitive 36) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessSettingsNavigation.kt:133 — HarnessSettingsNavigationKt.HarnessSettingsNavigator has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (30 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeChatToolRuntime.availableTools (cognitive 35) · ×1
  • NativeChatToolRuntime.availableTools (cognitive 35) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:970 — NativeChatToolRuntime.availableTools has cognitive complexity 35 (threshold 15). Drivers by points: if/else 24 (30 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TamaAgentService.summarize (cognitive 35) · ×1
  • TamaAgentService.summarize (cognitive 35) app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:658 — TamaAgentService.summarize has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22 (27 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TamaDailyDreamManager.queueDreamIfEligible (cognitive 35) · ×1
  • TamaDailyDreamManager.queueDreamIfEligible (cognitive 35) app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:129 — TamaDailyDreamManager.queueDreamIfEligible has cognitive complexity 35 (threshold 15). Drivers by points: if/else 25 (30 pts), boolean chains 4, error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentDialogsKt.AgentConfigCard (cognitive 35) · ×1
  • AgentDialogsKt.AgentConfigCard (cognitive 35) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4131 — AgentDialogsKt.AgentConfigCard has cognitive complexity 35 (threshold 15). Drivers by points: if/else 27 (31 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LlamaSchedulerScreenKt.LlamaScheduledTaskEditorDialog (cognitive 35) · ×1
  • LlamaSchedulerScreenKt.LlamaScheduledTaskEditorDialog (cognitive 35) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:652 — LlamaSchedulerScreenKt.LlamaScheduledTaskEditorDialog has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (21 pts), match/switch 3 (11 pts), boolean chains 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.
D2 · Cognitive Complexity · AgentService.runReflectionTool (cognitive 34) · ×1
  • AgentService.runReflectionTool (cognitive 34) app/src/main/java/com/example/llamadroid/service/AgentService.kt:15323 — AgentService.runReflectionTool has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 10, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DistributedLlamaLaunchResolver.resolve (cognitive 34) · ×1
  • DistributedLlamaLaunchResolver.resolve (cognitive 34) app/src/main/java/com/example/llamadroid/service/DistributedLlamaLaunchProfile.kt:194 — DistributedLlamaLaunchResolver.resolve has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17, boolean chains 9, match/switch 7 (8 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LlamaServerLaunchProfile.migrateJson (cognitive 34) · ×1
  • LlamaServerLaunchProfile.migrateJson (cognitive 34) app/src/main/java/com/example/llamadroid/service/LlamaServerLaunchProfile.kt:390 — LlamaServerLaunchProfile.migrateJson has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 10, match/switch 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.
D2 · Cognitive Complexity · PDFService.translatePageUnits (cognitive 34) · ×1
  • PDFService.translatePageUnits (cognitive 34) app/src/main/java/com/example/llamadroid/service/PDFService.kt:1299 — PDFService.translatePageUnits has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 6, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuadtrixTrainingService.runProcess (cognitive 34) · ×1
  • QuadtrixTrainingService.runProcess (cognitive 34) app/src/main/java/com/example/llamadroid/service/QuadtrixTrainingService.kt:302 — QuadtrixTrainingService.runProcess has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 6, match/switch 4, error handling 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubtitleBurnService.burnSubtitles (cognitive 34) · ×1
  • SubtitleBurnService.burnSubtitles (cognitive 34) app/src/main/java/com/example/llamadroid/service/SubtitleBurnService.kt:168 — SubtitleBurnService.burnSubtitles has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 7, error handling 4 (6 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PrepareCachesSheetKt.PrepareCachesSheet (cognitive 34) · ×1
  • PrepareCachesSheetKt.PrepareCachesSheet (cognitive 34) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:67 — PrepareCachesSheetKt.PrepareCachesSheet has cognitive complexity 34 (threshold 15). Drivers by points: if/else 27 (28 pts), boolean chains 5, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · EasyModelsScreenKt.EasyModelsScreen (cognitive 34) · ×1
  • EasyModelsScreenKt.EasyModelsScreen (cognitive 34) app/src/main/java/com/example/llamadroid/ui/easy/EasyModelsScreen.kt:114 — EasyModelsScreenKt.EasyModelsScreen has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (20 pts), match/switch 8 (9 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.
D2 · Cognitive Complexity · ModelSourceAttachmentKt.ModelSourceAttachmentDialog (cognitive 34) · ×1
  • ModelSourceAttachmentKt.ModelSourceAttachmentDialog (cognitive 34) app/src/main/java/com/example/llamadroid/ui/models/ModelSourceAttachment.kt:233 — ModelSourceAttachmentKt.ModelSourceAttachmentDialog has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 9 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · GGUFParser.readModelInfo (cognitive 34) · ×1
  • GGUFParser.readModelInfo (cognitive 34) app/src/main/java/com/example/llamadroid/util/GGUFParser.kt:39 — GGUFParser.readModelInfo has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 3, match/switch 1 (2 pts), error handling 1, 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.
D2 · Cognitive Complexity · OllamaRepository.inspectModelfile (cognitive 33) · ×1
  • OllamaRepository.inspectModelfile (cognitive 33) app/src/main/java/com/example/llamadroid/data/repository/OllamaRepository.kt:218 — OllamaRepository.inspectModelfile has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 7, match/switch 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentControlPromptSupportKt.evidenceRecordsFromContent (cognitive 33) · ×1
  • AgentControlPromptSupportKt.evidenceRecordsFromContent (cognitive 33) app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:407 — AgentControlPromptSupportKt.evidenceRecordsFromContent has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 10 (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.
D2 · Cognitive Complexity · AgentProjectControlPlane.applyDirectToolReceipt (cognitive 33) · ×1
  • AgentProjectControlPlane.applyDirectToolReceipt (cognitive 33) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:920 — AgentProjectControlPlane.applyDirectToolReceipt has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 15, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MangaTranslationSupport.preflight (cognitive 33) · ×1
  • MangaTranslationSupport.preflight (cognitive 33) app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:756 — MangaTranslationSupport.preflight has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 5, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessModelEditorKt.HarnessEditableModelRow (cognitive 33) · ×1
  • HarnessModelEditorKt.HarnessEditableModelRow (cognitive 33) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessModelEditor.kt:278 — HarnessModelEditorKt.HarnessEditableModelRow has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NativeHarnessPluginActions.cancel (cognitive 33) · ×1
  • NativeHarnessPluginActions.cancel (cognitive 33) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessPluginActions.kt:272 — NativeHarnessPluginActions.cancel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 10, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveTranslatorScreenKt.LiveTranslatorScreen (cognitive 33) · ×1
  • LiveTranslatorScreenKt.LiveTranslatorScreen (cognitive 33) app/src/main/java/com/example/llamadroid/ui/ai/LiveTranslatorScreen.kt:130 — LiveTranslatorScreenKt.LiveTranslatorScreen has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 11 (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.
D2 · Cognitive Complexity · AppChromeKt.AppHubRow (cognitive 33) · ×1
  • AppChromeKt.AppHubRow (cognitive 33) app/src/main/java/com/example/llamadroid/ui/components/AppChrome.kt:478 — AppChromeKt.AppHubRow has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23 (31 pts), match/switch 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.
D2 · Cognitive Complexity · CuratedModelBundlePickerKt.CuratedModelBundlePicker (cognitive 33) · ×1
  • CuratedModelBundlePickerKt.CuratedModelBundlePicker (cognitive 33) app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundlePicker.kt:111 — CuratedModelBundlePickerKt.CuratedModelBundlePicker has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 15 (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.
D2 · Cognitive Complexity · FullHfRepositoryBrowserKt.FullHfRepositoryBrowser (cognitive 33) · ×1
  • FullHfRepositoryBrowserKt.FullHfRepositoryBrowser (cognitive 33) app/src/main/java/com/example/llamadroid/ui/models/FullHfRepositoryBrowser.kt:63 — FullHfRepositoryBrowserKt.FullHfRepositoryBrowser has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 5, error handling 4, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FilePathResolver.resolveContentUri (cognitive 33) · ×1
  • FilePathResolver.resolveContentUri (cognitive 33) app/src/main/java/com/example/llamadroid/util/FilePathResolver.kt:73 — FilePathResolver.resolveContentUri has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (26 pts), loops 1 (4 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 23). 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.
D2 · Cognitive Complexity · HarnessTransferPublication.prepareAndPublish (cognitive 32) · ×1
  • HarnessTransferPublication.prepareAndPublish (cognitive 32) app/src/main/java/com/example/llamadroid/harness/HarnessTransferPublication.kt:60 — HarnessTransferPublication.prepareAndPublish has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (21 pts), boolean chains 11 (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.
D2 · Cognitive Complexity · AgentService.approvePendingPlan (cognitive 32) · ×1
  • AgentService.approvePendingPlan (cognitive 32) app/src/main/java/com/example/llamadroid/service/AgentService.kt:7093 — AgentService.approvePendingPlan has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (18 pts), error handling 4 (8 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.
D2 · Cognitive Complexity · LlamaClientService.streamLiteRtLmRequestSafely (cognitive 32) · ×1
  • LlamaClientService.streamLiteRtLmRequestSafely (cognitive 32) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:2708 — LlamaClientService.streamLiteRtLmRequestSafely has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 5 (12 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · MediaTranslationWorkflowService.runProcessWithSrtProgress (cognitive 32) · ×1
  • MediaTranslationWorkflowService.runProcessWithSrtProgress (cognitive 32) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:2656 — MediaTranslationWorkflowService.runProcessWithSrtProgress has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelegationProjectFiles.search (cognitive 32) · ×1
  • DelegationProjectFiles.search (cognitive 32) app/src/main/java/com/example/llamadroid/service/delegation/DelegationProjectFiles.kt:131 — DelegationProjectFiles.search has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelegationStatusFormatter.statusText (cognitive 32) · ×1
  • DelegationStatusFormatter.statusText (cognitive 32) app/src/main/java/com/example/llamadroid/service/delegation/DelegationStatusFormatter.kt:38 — DelegationStatusFormatter.statusText has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentDialogsKt.AgentDirectRuntimeCard (cognitive 32) · ×1
  • AgentDialogsKt.AgentDirectRuntimeCard (cognitive 32) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2471 — AgentDialogsKt.AgentDirectRuntimeCard has cognitive complexity 32 (threshold 15). Drivers by points: if/else 26 (30 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentDialogsKt.AgentTuningCard (cognitive 32) · ×1
  • AgentDialogsKt.AgentTuningCard (cognitive 32) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3440 — AgentDialogsKt.AgentTuningCard has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 3, match/switch 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VideoGenScreenKt.VideoDetailDialog (cognitive 32) · ×1
  • VideoGenScreenKt.VideoDetailDialog (cognitive 32) app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:2147 — VideoGenScreenKt.VideoDetailDialog has cognitive complexity 32 (threshold 15). Drivers by points: if/else 28 (30 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AudioWorkspaceScreenKt.AudioWorkspaceScreen (cognitive 32) · ×1
  • AudioWorkspaceScreenKt.AudioWorkspaceScreen (cognitive 32) app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceScreen.kt:122 — AudioWorkspaceScreenKt.AudioWorkspaceScreen has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (22 pts), error handling 2 (4 pts), boolean chains 3, match/switch 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SoftStudioAppScaffoldKt.SoftStudioAppScaffold (cognitive 32) · ×1
  • SoftStudioAppScaffoldKt.SoftStudioAppScaffold (cognitive 32) app/src/main/java/com/example/llamadroid/ui/navigation/SoftStudioAppScaffold.kt:76 — SoftStudioAppScaffoldKt.SoftStudioAppScaffold has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · WalkthroughUiKt.WalkthroughCoach (cognitive 32) · ×1
  • WalkthroughUiKt.WalkthroughCoach (cognitive 32) app/src/main/java/com/example/llamadroid/ui/walkthrough/WalkthroughUi.kt:90 — WalkthroughUiKt.WalkthroughCoach has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 6, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessWebIndexBodyKt.readHarnessWebIndexBody (cognitive 31) · ×1
  • HarnessWebIndexBodyKt.readHarnessWebIndexBody (cognitive 31) app/src/main/java/com/example/llamadroid/harness/HarnessWebIndexBody.kt:8 — HarnessWebIndexBodyKt.readHarnessWebIndexBody has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 5 (10 pts), boolean chains 2, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassicFarmPlots.apply (cognitive 31) · ×1
  • ClassicFarmPlots.apply (cognitive 31) app/src/main/java/com/example/llamadroid/tama/game/ClassicFarmPlots.kt:70 — ClassicFarmPlots.apply has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 13, match/switch 2 (3 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AgentChatListKt.ChatMessageContent (cognitive 31) · ×1
  • AgentChatListKt.ChatMessageContent (cognitive 31) app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:1644 — AgentChatListKt.ChatMessageContent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · WorkflowsScreenKt.SubtitleTranslationWorkflowContent (cognitive 31) · ×1
  • WorkflowsScreenKt.SubtitleTranslationWorkflowContent (cognitive 31) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4017 — WorkflowsScreenKt.SubtitleTranslationWorkflowContent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 6, error handling 5 (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.
D2 · Cognitive Complexity · EasyLlamaChatUiKt.EasyLlamaChatEntryCard (cognitive 31) · ×1
  • EasyLlamaChatUiKt.EasyLlamaChatEntryCard (cognitive 31) app/src/main/java/com/example/llamadroid/ui/ai/llama/EasyLlamaChatUi.kt:221 — EasyLlamaChatUiKt.EasyLlamaChatEntryCard has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (23 pts), error handling 4 (8 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeChatDelegationScreenKt.DelegationHeader (cognitive 31) · ×1
  • NativeChatDelegationScreenKt.DelegationHeader (cognitive 31) app/src/main/java/com/example/llamadroid/ui/ai/llama/delegation/NativeChatDelegationScreen.kt:139 — NativeChatDelegationScreenKt.DelegationHeader has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22 (27 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ModelSourceRepository.saveSource (cognitive 30) · ×1
  • ModelSourceRepository.saveSource (cognitive 30) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:207 — ModelSourceRepository.saveSource has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessInstallationTransfer.export (cognitive 30) · ×1
  • HarnessInstallationTransfer.export (cognitive 30) app/src/main/java/com/example/llamadroid/harness/HarnessInstallationTransfer.kt:111 — HarnessInstallationTransfer.export has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 12, error handling 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HarnessInstallationsBindingKt.rememberHarnessInstallations (cognitive 30) · ×1
  • HarnessInstallationsBindingKt.rememberHarnessInstallations (cognitive 30) app/src/main/java/com/example/llamadroid/harness/HarnessInstallationsBinding.kt:29 — HarnessInstallationsBindingKt.rememberHarnessInstallations has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 14, if/else 10, match/switch 3 (4 pts), error handling 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · HarnessTransferCodec.scanTree (cognitive 30) · ×1
  • HarnessTransferCodec.scanTree (cognitive 30) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:506 — HarnessTransferCodec.scanTree has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 10, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentLocalPatchSupport.apply (cognitive 30) · ×1
  • AgentLocalPatchSupport.apply (cognitive 30) app/src/main/java/com/example/llamadroid/service/AgentLocalPatchSupport.kt:32 — AgentLocalPatchSupport.apply has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (6 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.
D2 · Cognitive Complexity · AgentService.webSearch (cognitive 30) · ×1
  • AgentService.webSearch (cognitive 30) app/src/main/java/com/example/llamadroid/service/AgentService.kt:20527 — AgentService.webSearch has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (23 pts), error handling 3 (6 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.normalizeMessageForPrompt (cognitive 30) · ×1
  • AgentService.normalizeMessageForPrompt (cognitive 30) app/src/main/java/com/example/llamadroid/service/AgentService.kt:15773 — AgentService.normalizeMessageForPrompt has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 3, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaServerSessionService.onStartCommand (cognitive 30) · ×1
  • LlamaServerSessionService.onStartCommand (cognitive 30) app/src/main/java/com/example/llamadroid/service/LlamaServerSessionService.kt:46 — LlamaServerSessionService.onStartCommand has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 2, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoGenerationService.convertNativeOutput (cognitive 30) · ×1
  • VideoGenerationService.convertNativeOutput (cognitive 30) app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:852 — VideoGenerationService.convertNativeOutput has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 7, 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.
D2 · Cognitive Complexity · FarmObstacles.plan (cognitive 30) · ×1
  • FarmObstacles.plan (cognitive 30) app/src/main/java/com/example/llamadroid/tama/data/FarmObstacleData.kt:88 — FarmObstacles.plan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdventureGateScreenKt.gearInfoText (cognitive 30) · ×1
  • AdventureGateScreenKt.gearInfoText (cognitive 30) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:4551 — AdventureGateScreenKt.gearInfoText has cognitive complexity 30 (threshold 15). Drivers by points: if/else 29, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TamaScreenKt.TamaParkEncounterDialog (cognitive 30) · ×1
  • TamaScreenKt.TamaParkEncounterDialog (cognitive 30) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:1316 — TamaScreenKt.TamaParkEncounterDialog has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (21 pts), boolean chains 7, match/switch 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.
D2 · Cognitive Complexity · NativeHarnessProjectReviewModelsKt.foldNativeHarnessWorkflows (cognitive 30) · ×1
  • NativeHarnessProjectReviewModelsKt.foldNativeHarnessWorkflows (cognitive 30) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProjectReviewModels.kt:467 — NativeHarnessProjectReviewModelsKt.foldNativeHarnessWorkflows has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 6, match/switch 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SDModelsScreenKt.SdInspectionEvidence (cognitive 30) · ×1
  • SDModelsScreenKt.SdInspectionEvidence (cognitive 30) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:3187 — SDModelsScreenKt.SdInspectionEvidence has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdIpAdapterControlsKt.SdIpAdapterCard (cognitive 30) · ×1
  • SdIpAdapterControlsKt.SdIpAdapterCard (cognitive 30) app/src/main/java/com/example/llamadroid/ui/ai/SdIpAdapterControls.kt:70 — SdIpAdapterControlsKt.SdIpAdapterCard has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 11, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VideoRuntimeOptionsEditorKt.VideoRuntimeOptionsEditor (cognitive 30) · ×1
  • VideoRuntimeOptionsEditorKt.VideoRuntimeOptionsEditor (cognitive 30) app/src/main/java/com/example/llamadroid/ui/components/VideoRuntimeOptionsEditor.kt:82 — VideoRuntimeOptionsEditorKt.VideoRuntimeOptionsEditor has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 7, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EasyChatTabKt.EasyChatTab (cognitive 30) · ×1
  • EasyChatTabKt.EasyChatTab (cognitive 30) app/src/main/java/com/example/llamadroid/ui/easy/EasyChatTab.kt:63 — EasyChatTabKt.EasyChatTab has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (20 pts), error handling 6 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EasyImagesTabKt.EasyImagesTab (cognitive 30) · ×1
  • EasyImagesTabKt.EasyImagesTab (cognitive 30) app/src/main/java/com/example/llamadroid/ui/easy/EasyImagesTab.kt:98 — EasyImagesTabKt.EasyImagesTab has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 9, match/switch 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · app.renderField (cognitive 30) · ×1
  • app.renderField (cognitive 30) app/src/main/assets/ai_servers_webui/app.js:537 — app.renderField has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 11 (19 pts), if/else 7 (8 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · upload.run (cognitive 30) · ×1
  • upload.run (cognitive 30) app/src/main/assets/file_station_webui/js/upload.js:47 — upload.run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 8, error handling 3 (7 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StableAudio3WorkerClient.run (cognitive 29) · ×1
  • StableAudio3WorkerClient.run (cognitive 29) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3WorkerClient.kt:21 — StableAudio3WorkerClient.run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, loops 3, error handling 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessPresetFilesDialogKt.HarnessPresetFilesDialog (cognitive 29) · ×1
  • HarnessPresetFilesDialogKt.HarnessPresetFilesDialog (cognitive 29) app/src/main/java/com/example/llamadroid/harness/HarnessPresetFilesDialog.kt:53 — HarnessPresetFilesDialogKt.HarnessPresetFilesDialog has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, error handling 4, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SdModelSupportKt.inferSdFamily (cognitive 29) · ×1
  • SdModelSupportKt.inferSdFamily (cognitive 29) app/src/main/java/com/example/llamadroid/sd/SdModelSupport.kt:523 — SdModelSupportKt.inferSdFamily has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 12, match/switch 6 (11 pts), if/else 6 (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.
D2 · Cognitive Complexity · SdPipelineResolver.resolve (cognitive 29) · ×1
  • SdPipelineResolver.resolve (cognitive 29) app/src/main/java/com/example/llamadroid/sd/SdPipelineResolver.kt:118 — SdPipelineResolver.resolve has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 9, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ForegroundStart.start (cognitive 29) · ×1
  • ForegroundStart.start (cognitive 29) app/src/main/java/com/example/llamadroid/service/ForegroundStart.kt:75 — ForegroundStart.start has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 3 (7 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaScheduledTaskRunner.runTask (cognitive 29) · ×1
  • LlamaScheduledTaskRunner.runTask (cognitive 29) app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskRunner.kt:35 — LlamaScheduledTaskRunner.runTask has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (20 pts), error handling 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DelegateHarnessDriver.waitFor (cognitive 29) · ×1
  • DelegateHarnessDriver.waitFor (cognitive 29) app/src/main/java/com/example/llamadroid/service/delegation/DelegateHarnessDriver.kt:401 — DelegateHarnessDriver.waitFor has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeHarnessStructuredTranscriptKt.parseNativeHarnessStructuredTranscript (cognitive 29) · ×1
  • NativeHarnessStructuredTranscriptKt.parseNativeHarnessStructuredTranscript (cognitive 29) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessStructuredTranscript.kt:130 — NativeHarnessStructuredTranscriptKt.parseNativeHarnessStructuredTranscript has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 4 (9 pts), boolean chains 2 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · KnowledgeBaseScreenKt.KnowledgeEmbeddingServerCard (cognitive 29) · ×1
  • KnowledgeBaseScreenKt.KnowledgeEmbeddingServerCard (cognitive 29) app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:646 — KnowledgeBaseScreenKt.KnowledgeEmbeddingServerCard has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19, boolean chains 8, match/switch 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · app.wireChatControls (cognitive 29) · ×1
  • app.wireChatControls (cognitive 29) app/src/main/assets/ai_servers_webui/app.js:1226 — app.wireChatControls has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 4 (nesting depth added 3). Of this number, 19 points are the body's own statements and 10 belong to 5 function literals inside it that branch. 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.
D2 · Cognitive Complexity · LiteRtModelRepository.pruneManagedRowsIfNeeded (cognitive 28) · ×1
  • LiteRtModelRepository.pruneManagedRowsIfNeeded (cognitive 28) app/src/main/java/com/example/llamadroid/data/repository/LiteRtModelRepository.kt:997 — LiteRtModelRepository.pruneManagedRowsIfNeeded has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · HarnessTransferCodec.stage (cognitive 28) · ×1
  • HarnessTransferCodec.stage (cognitive 28) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:243 — HarnessTransferCodec.stage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 11, error handling 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HarnessTaskDigest.foldEvent (cognitive 28) · ×1
  • HarnessTaskDigest.foldEvent (cognitive 28) app/src/main/java/com/example/llamadroid/service/delegation/HarnessTaskDigest.kt:174 — HarnessTaskDigest.foldEvent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, match/switch 2 (4 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.
D2 · Cognitive Complexity · AdventureGateCombatEngine.applyPetDamage (cognitive 28) · ×1
  • AdventureGateCombatEngine.applyPetDamage (cognitive 28) app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateCombatEngine.kt:756 — AdventureGateCombatEngine.applyPetDamage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, boolean chains 7, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TamaScreenKt.TamaControls (cognitive 28) · ×1
  • TamaScreenKt.TamaControls (cognitive 28) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5293 — TamaScreenKt.TamaControls has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 11, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentControlsKt.AgentWorkspaceConsoleHeader (cognitive 28) · ×1
  • AgentControlsKt.AgentWorkspaceConsoleHeader (cognitive 28) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:243 — AgentControlsKt.AgentWorkspaceConsoleHeader has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23 (26 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.
D2 · Cognitive Complexity · HarnessConversationPanelKt.HarnessChatTab (cognitive 28) · ×1
  • HarnessConversationPanelKt.HarnessChatTab (cognitive 28) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessConversationPanel.kt:31 — HarnessConversationPanelKt.HarnessChatTab has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · HarnessProjectActionDialogKt.HarnessProjectBatchRemovalDialog (cognitive 28) · ×1
  • HarnessProjectActionDialogKt.HarnessProjectBatchRemovalDialog (cognitive 28) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessProjectActionDialog.kt:343 — HarnessProjectActionDialogKt.HarnessProjectBatchRemovalDialog has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 10, error handling 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NativeHarnessCommandHistoryKt.mergeNativeHarnessCommandRuns (cognitive 28) · ×1
  • NativeHarnessCommandHistoryKt.mergeNativeHarnessCommandRuns (cognitive 28) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCommandHistory.kt:43 — NativeHarnessCommandHistoryKt.mergeNativeHarnessCommandRuns has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 4 (8 pts), boolean chains 7 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · NativeHarnessStructuredTranscriptActions.loadDetail (cognitive 28) · ×1
  • NativeHarnessStructuredTranscriptActions.loadDetail (cognitive 28) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessStructuredTranscriptActions.kt:29 — NativeHarnessStructuredTranscriptActions.loadDetail has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (22 pts), error handling 2, match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveTranslatorScreenKt.LiveTranslatorBackendCard (cognitive 28) · ×1
  • LiveTranslatorScreenKt.LiveTranslatorBackendCard (cognitive 28) app/src/main/java/com/example/llamadroid/ui/ai/LiveTranslatorScreen.kt:800 — LiveTranslatorScreenKt.LiveTranslatorBackendCard has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 4 (8 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TermuxScreenKt.ToolRunItem (cognitive 28) · ×1
  • TermuxScreenKt.ToolRunItem (cognitive 28) app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:1490 — TermuxScreenKt.ToolRunItem has cognitive complexity 28 (threshold 15). Drivers by points: if/else 26, 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.
D2 · Cognitive Complexity · VideoInputPickerKt.VideoInputPicker (cognitive 28) · ×1
  • VideoInputPickerKt.VideoInputPicker (cognitive 28) app/src/main/java/com/example/llamadroid/ui/components/VideoInputPicker.kt:33 — VideoInputPickerKt.VideoInputPicker has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (16 pts), error handling 4 (8 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · GeneralSettingsScreenKt.NativeBinaryCatalogSheet (cognitive 28) · ×1
  • GeneralSettingsScreenKt.NativeBinaryCatalogSheet (cognitive 28) app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:1240 — GeneralSettingsScreenKt.NativeBinaryCatalogSheet has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 4, match/switch 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SystemMonitor.readCpu (cognitive 28) · ×1
  • SystemMonitor.readCpu (cognitive 28) app/src/main/java/com/example/llamadroid/util/SystemMonitor.kt:114 — SystemMonitor.readCpu has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 8, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AudioGenerationService.onStartCommand (cognitive 27) · ×1
  • AudioGenerationService.onStartCommand (cognitive 27) app/src/main/java/com/example/llamadroid/audio/AudioGenerationService.kt:59 — AudioGenerationService.onStartCommand has cognitive complexity 27 (threshold 15). Drivers by points: error handling 5 (13 pts), if/else 5 (10 pts), boolean chains 3, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelArtifactRecognizer.isLikelyOnnxFile (cognitive 27) · ×1
  • ModelArtifactRecognizer.isLikelyOnnxFile (cognitive 27) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:579 — ModelArtifactRecognizer.isLikelyOnnxFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentControlPromptSupportKt.preserveToolControlContent (cognitive 27) · ×1
  • AgentControlPromptSupportKt.preserveToolControlContent (cognitive 27) app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:828 — AgentControlPromptSupportKt.preserveToolControlContent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 6, match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentService.setIsLoading (cognitive 27) · ×1
  • AgentService.setIsLoading (cognitive 27) app/src/main/java/com/example/llamadroid/service/AgentService.kt:3141 — AgentService.setIsLoading has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 3, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadService.finalizePendingDownload (cognitive 27) · ×1
  • DownloadService.finalizePendingDownload (cognitive 27) app/src/main/java/com/example/llamadroid/service/DownloadService.kt:1791 — DownloadService.finalizePendingDownload has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 4, error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoGenerationService.runGeneration (cognitive 27) · ×1
  • VideoGenerationService.runGeneration (cognitive 27) app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:359 — VideoGenerationService.runGeneration has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PetTransferCoordinator.runOutbound (cognitive 27) · ×1
  • PetTransferCoordinator.runOutbound (cognitive 27) app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferCoordinator.kt:244 — PetTransferCoordinator.runOutbound has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22 (23 pts), boolean chains 2, error handling 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FarmLivestockScreenKt.FarmLivestockScreen (cognitive 27) · ×1
  • FarmLivestockScreenKt.FarmLivestockScreen (cognitive 27) app/src/main/java/com/example/llamadroid/tama/ui/FarmLivestockScreen.kt:132 — FarmLivestockScreenKt.FarmLivestockScreen has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, boolean chains 3, loops 1, 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.
D2 · Cognitive Complexity · DatasetProjectScreenKt.ChunksTab (cognitive 27) · ×1
  • DatasetProjectScreenKt.ChunksTab (cognitive 27) app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:877 — DatasetProjectScreenKt.ChunksTab has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25 (26 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.
D2 · Cognitive Complexity · ModelManagerScreenKt.DiscoverTab (cognitive 27) · ×1
  • ModelManagerScreenKt.DiscoverTab (cognitive 27) app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1296 — ModelManagerScreenKt.DiscoverTab has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 9 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ModelShareScreenKt.ModelShareScreen (cognitive 27) · ×1
  • ModelShareScreenKt.ModelShareScreen (cognitive 27) app/src/main/java/com/example/llamadroid/ui/models/ModelShareScreen.kt:53 — ModelShareScreenKt.ModelShareScreen has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AudioGenerationService.runJob (cognitive 26) · ×1
  • AudioGenerationService.runJob (cognitive 26) app/src/main/java/com/example/llamadroid/audio/AudioGenerationService.kt:293 — AudioGenerationService.runJob has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (19 pts), error handling 3 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentService.deleteMemoryLines (cognitive 26) · ×1
  • AgentService.deleteMemoryLines (cognitive 26) app/src/main/java/com/example/llamadroid/service/AgentService.kt:20197 — AgentService.deleteMemoryLines has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFService.recognizePaintedTextBlocksWithLlama (cognitive 26) · ×1
  • PDFService.recognizePaintedTextBlocksWithLlama (cognitive 26) app/src/main/java/com/example/llamadroid/service/PDFService.kt:4028 — PDFService.recognizePaintedTextBlocksWithLlama has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FsReadApi.search (cognitive 26) · ×1
  • FsReadApi.search (cognitive 26) REDACTED:97 — FsReadApi.search has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VolumeRegistry.transferNamed (cognitive 26) · ×1
  • VolumeRegistry.transferNamed (cognitive 26) app/src/main/java/com/example/llamadroid/service/filestation/volume/VolumeRegistry.kt:109 — VolumeRegistry.transferNamed has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, match/switch 1 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArcadeMemoryGameKt.MemoryCardTile (cognitive 26) · ×1
  • ArcadeMemoryGameKt.MemoryCardTile (cognitive 26) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:490 — ArcadeMemoryGameKt.MemoryCardTile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 8 (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.
D2 · Cognitive Complexity · HarnessExtensionsPanelsKt.HarnessPluginsCard (cognitive 26) · ×1
  • HarnessExtensionsPanelsKt.HarnessPluginsCard (cognitive 26) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessExtensionsPanels.kt:201 — HarnessExtensionsPanelsKt.HarnessPluginsCard has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, match/switch 3 (5 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HarnessScreenKt.HarnessSchemaFieldControl (cognitive 26) · ×1
  • HarnessScreenKt.HarnessSchemaFieldControl (cognitive 26) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1876 — HarnessScreenKt.HarnessSchemaFieldControl has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 3 (7 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · NativeHarnessQueueStore.parseItem (cognitive 26) · ×1
  • NativeHarnessQueueStore.parseItem (cognitive 26) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessQueueActions.kt:132 — NativeHarnessQueueStore.parseItem has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoReuseDialogKt.VideoReuseDialog (cognitive 26) · ×1
  • VideoReuseDialogKt.VideoReuseDialog (cognitive 26) app/src/main/java/com/example/llamadroid/ui/ai/VideoReuseDialog.kt:24 — VideoReuseDialogKt.VideoReuseDialog has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · NativeChatWorkspaceDialogKt.NativeChatWorkspaceDialog (cognitive 26) · ×1
  • NativeChatWorkspaceDialogKt.NativeChatWorkspaceDialog (cognitive 26) app/src/main/java/com/example/llamadroid/ui/ai/llama/NativeChatWorkspaceDialog.kt:52 — NativeChatWorkspaceDialogKt.NativeChatWorkspaceDialog has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatMessageItemKt.ThinkingMessageContent (cognitive 26) · ×1
  • ChatMessageItemKt.ThinkingMessageContent (cognitive 26) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageItem.kt:561 — ChatMessageItemKt.ThinkingMessageContent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatMessageListKt.ChatMessageList (cognitive 26) · ×1
  • ChatMessageListKt.ChatMessageList (cognitive 26) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageList.kt:37 — ChatMessageListKt.ChatMessageList has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ChatTopBarKt.ChatTopBar (cognitive 26) · ×1
  • ChatTopBarKt.ChatTopBar (cognitive 26) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatTopBar.kt:64 — ChatTopBarKt.ChatTopBar has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22 (23 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AllMediaGalleryScreenKt.AllMediaGalleryScreen (cognitive 26) · ×1
  • AllMediaGalleryScreenKt.AllMediaGalleryScreen (cognitive 26) app/src/main/java/com/example/llamadroid/ui/library/AllMediaGalleryScreen.kt:106 — AllMediaGalleryScreenKt.AllMediaGalleryScreen has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ModelArtifactRecognizer.isLikelyWhisperFile (cognitive 25) · ×1
  • ModelArtifactRecognizer.isLikelyWhisperFile (cognitive 25) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:841 — ModelArtifactRecognizer.isLikelyWhisperFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 7, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessBridgeOperations.appToolsStatus (cognitive 25) · ×1
  • HarnessBridgeOperations.appToolsStatus (cognitive 25) app/src/main/java/com/example/llamadroid/harness/HarnessBridgeOperations.kt:350 — HarnessBridgeOperations.appToolsStatus has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LiteRtLmReflectionBridge.generateStreaming (cognitive 25) · ×1
  • LiteRtLmReflectionBridge.generateStreaming (cognitive 25) app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:1551 — LiteRtLmReflectionBridge.generateStreaming has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiteRtLmChatServiceKt.compactLiteRtSchemaValue (cognitive 25) · ×1
  • LiteRtLmChatServiceKt.compactLiteRtSchemaValue (cognitive 25) app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:833 — LiteRtLmChatServiceKt.compactLiteRtSchemaValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 11). 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.
D2 · Cognitive Complexity · NativeChatToolConfig.effectiveWithServerDefaults (cognitive 25) · ×1
  • NativeChatToolConfig.effectiveWithServerDefaults (cognitive 25) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:320 — NativeChatToolConfig.effectiveWithServerDefaults has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 25. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · QuadtrixTrainingService.startProfile (cognitive 25) · ×1
  • QuadtrixTrainingService.startProfile (cognitive 25) app/src/main/java/com/example/llamadroid/service/QuadtrixTrainingService.kt:119 — QuadtrixTrainingService.startProfile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23 (24 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.
D2 · Cognitive Complexity · VideoUpscalerService.upscaleFrames (cognitive 25) · ×1
  • VideoUpscalerService.upscaleFrames (cognitive 25) app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:431 — VideoUpscalerService.upscaleFrames has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, error handling 2 (3 pts), loops 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TamaGameEngine.restoreTransferBundle (cognitive 25) · ×1
  • TamaGameEngine.restoreTransferBundle (cognitive 25) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:3523 — TamaGameEngine.restoreTransferBundle has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23 (24 pts), loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ShimejiOverlayService.configureTouch (cognitive 25) · ×1
  • ShimejiOverlayService.configureTouch (cognitive 25) app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiOverlayService.kt:556 — ShimejiOverlayService.configureTouch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 2, match/switch 1 (nesting depth added 12). 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.
D2 · Cognitive Complexity · StoreScreenKt.StoreItemRow (cognitive 25) · ×1
  • StoreScreenKt.StoreItemRow (cognitive 25) app/src/main/java/com/example/llamadroid/tama/ui/StoreScreen.kt:551 — StoreScreenKt.StoreItemRow has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23 (25 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentChatListKt.ToolCallGroupRow (cognitive 25) · ×1
  • AgentChatListKt.ToolCallGroupRow (cognitive 25) app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:665 — AgentChatListKt.ToolCallGroupRow has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessRuntimeInstallationsKt.RuntimeInstallationCard (cognitive 25) · ×1
  • HarnessRuntimeInstallationsKt.RuntimeInstallationCard (cognitive 25) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeInstallations.kt:397 — HarnessRuntimeInstallationsKt.RuntimeInstallationCard has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 9 (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.
D2 · Cognitive Complexity · HarnessScreenKt.HarnessTranscriptCard (cognitive 25) · ×1
  • HarnessScreenKt.HarnessTranscriptCard (cognitive 25) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:649 — HarnessScreenKt.HarnessTranscriptCard has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 5, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NativeHarnessProviderSaveKt.parseProviderField (cognitive 25) · ×1
  • NativeHarnessProviderSaveKt.parseProviderField (cognitive 25) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProviderSave.kt:95 — NativeHarnessProviderSaveKt.parseProviderField has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · NativeHarnessSchemaKeysKt.harnessSchemaPathFromKey (cognitive 25) · ×1
  • NativeHarnessSchemaKeysKt.harnessSchemaPathFromKey (cognitive 25) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessSchemaKeys.kt:12 — NativeHarnessSchemaKeysKt.harnessSchemaPathFromKey has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GenerationQueueScreenKt.GenerationQueueHistoryScreen (cognitive 25) · ×1
  • GenerationQueueScreenKt.GenerationQueueHistoryScreen (cognitive 25) app/src/main/java/com/example/llamadroid/ui/ai/GenerationQueueScreen.kt:284 — GenerationQueueScreenKt.GenerationQueueHistoryScreen has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · InpaintMaskEditorKt.InpaintMaskEditorContent (cognitive 25) · ×1
  • InpaintMaskEditorKt.InpaintMaskEditorContent (cognitive 25) app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskEditor.kt:148 — InpaintMaskEditorKt.InpaintMaskEditorContent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, loops 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatSettingsSectionsKt.ImageToolsSection (cognitive 25) · ×1
  • ChatSettingsSectionsKt.ImageToolsSection (cognitive 25) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsSections.kt:578 — ChatSettingsSectionsKt.ImageToolsSection has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 3 (11 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelLibraryScreenKt.ModelLibraryScreen (cognitive 25) · ×1
  • ModelLibraryScreenKt.ModelLibraryScreen (cognitive 25) app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryScreen.kt:113 — ModelLibraryScreenKt.ModelLibraryScreen has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4, match/switch 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · GlobalSearchScreenKt.GlobalSearchScreen (cognitive 25) · ×1
  • GlobalSearchScreenKt.GlobalSearchScreen (cognitive 25) app/src/main/java/com/example/llamadroid/ui/search/GlobalSearchScreen.kt:119 — GlobalSearchScreenKt.GlobalSearchScreen has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (25 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.
D2 · Cognitive Complexity · SystemPromptsSettingsScreenKt.SystemPromptsSettingsScreen (cognitive 25) · ×1
  • SystemPromptsSettingsScreenKt.SystemPromptsSettingsScreen (cognitive 25) app/src/main/java/com/example/llamadroid/ui/settings/SystemPromptsSettingsScreen.kt:35 — SystemPromptsSettingsScreenKt.SystemPromptsSettingsScreen has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (18 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MainActivityKt.OrganizerScreen (cognitive 25) · ×1
  • MainActivityKt.OrganizerScreen (cognitive 25) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2243 — MainActivityKt.OrganizerScreen has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · app.collectParams (cognitive 25) · ×1
  • app.collectParams (cognitive 25) app/src/main/assets/ai_servers_webui/app.js:1583 — app.collectParams has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 5, ternaries 1 (nesting depth added 5). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1586, 1615). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · selection.initSelection (cognitive 25) · ×1
  • selection.initSelection (cognitive 25) app/src/main/assets/file_station_webui/js/selection.js:153 — selection.initSelection has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 9, match/switch 1 (nesting depth added 3). None of this is in the body itself: all 25 points belong to 2 function literals inside it that branch (lines 175, 155). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · BinaryRepository.deployAllBinaries (cognitive 24) · ×1
  • BinaryRepository.deployAllBinaries (cognitive 24) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1215 — BinaryRepository.deployAllBinaries has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · BinaryRepository.resolveLlamaBinary (cognitive 24) · ×1
  • BinaryRepository.resolveLlamaBinary (cognitive 24) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:191 — BinaryRepository.resolveLlamaBinary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RestoreCoordinator.installPending (cognitive 24) · ×1
  • RestoreCoordinator.installPending (cognitive 24) app/src/main/java/com/example/llamadroid/data/db/RestoreCoordinator.kt:265 — RestoreCoordinator.installPending has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (16 pts), error handling 4 (5 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessAppToolsSettingsKt.HarnessAppToolsSettingsDialog (cognitive 24) · ×1
  • HarnessAppToolsSettingsKt.HarnessAppToolsSettingsDialog (cognitive 24) app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:54 — HarnessAppToolsSettingsKt.HarnessAppToolsSettingsDialog has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, boolean chains 7, match/switch 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SdArtifactInspector.detectVideoFamily (cognitive 24) · ×1
  • SdArtifactInspector.detectVideoFamily (cognitive 24) app/src/main/java/com/example/llamadroid/sd/SdArtifactInspector.kt:805 — SdArtifactInspector.detectVideoFamily has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, match/switch 5 (8 pts), if/else 5 (nesting depth added 3). 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.
D2 · Cognitive Complexity · AgentService.recoverToolCallAttempt (cognitive 24) · ×1
  • AgentService.recoverToolCallAttempt (cognitive 24) app/src/main/java/com/example/llamadroid/service/AgentService.kt:16479 — AgentService.recoverToolCallAttempt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolHttpServer.routeApi (cognitive 24) · ×1
  • ToolHttpServer.routeApi (cognitive 24) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:348 — ToolHttpServer.routeApi has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 22, if/else 1, match/switch 1. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TombstoneWireReader.message (cognitive 24) · ×1
  • TombstoneWireReader.message (cognitive 24) app/src/main/java/com/example/llamadroid/service/AndroidTombstoneSummary.kt:97 — TombstoneWireReader.message has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DistributedService.startMasterConnectionMonitor (cognitive 24) · ×1
  • DistributedService.startMasterConnectionMonitor (cognitive 24) app/src/main/java/com/example/llamadroid/service/DistributedService.kt:1172 — DistributedService.startMasterConnectionMonitor has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaServerSessionRuntime.launchProcess (cognitive 24) · ×1
  • LlamaServerSessionRuntime.launchProcess (cognitive 24) app/src/main/java/com/example/llamadroid/service/LlamaServerSessionRuntime.kt:403 — LlamaServerSessionRuntime.launchProcess has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 2, error handling 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.
D2 · Cognitive Complexity · PDFService.renderTranslatedComicPagesToPng (cognitive 24) · ×1
  • PDFService.renderTranslatedComicPagesToPng (cognitive 24) app/src/main/java/com/example/llamadroid/service/PDFService.kt:6896 — PDFService.renderTranslatedComicPagesToPng has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 2, 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.
D2 · Cognitive Complexity · SSHService.executeCommandForTool (cognitive 24) · ×1
  • SSHService.executeCommandForTool (cognitive 24) app/src/main/java/com/example/llamadroid/service/SSHService.kt:693 — SSHService.executeCommandForTool has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (5 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdDistributedRuntimeKt.buildRamWeightedSdPlacementPlan (cognitive 24) · ×1
  • SdDistributedRuntimeKt.buildRamWeightedSdPlacementPlan (cognitive 24) app/src/main/java/com/example/llamadroid/service/SdDistributedRuntime.kt:234 — SdDistributedRuntimeKt.buildRamWeightedSdPlacementPlan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · UnifiedNotificationManager.showTaskNotification (cognitive 24) · ×1
  • UnifiedNotificationManager.showTaskNotification (cognitive 24) app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:677 — UnifiedNotificationManager.showTaskNotification has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9, match/switch 2, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TamaGameEngine.buyItemLocked (cognitive 24) · ×1
  • TamaGameEngine.buyItemLocked (cognitive 24) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2694 — TamaGameEngine.buyItemLocked has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 9, match/switch 1 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TamaStudySessionSupport.advanceActiveSession (cognitive 24) · ×1
  • TamaStudySessionSupport.advanceActiveSession (cognitive 24) app/src/main/java/com/example/llamadroid/tama/game/TamaStudySessionSupport.kt:79 — TamaStudySessionSupport.advanceActiveSession has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PetTransferServer.hello (cognitive 24) · ×1
  • PetTransferServer.hello (cognitive 24) app/src/main/java/com/example/llamadroid/tama/transfer/PetTransferServer.kt:149 — PetTransferServer.hello has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · ArcadeScreenKt.advanceCatchGame (cognitive 24) · ×1
  • ArcadeScreenKt.advanceCatchGame (cognitive 24) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:1503 — ArcadeScreenKt.advanceCatchGame has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 3, match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TamaMapViewKt.LocationDetailsDialog (cognitive 24) · ×1
  • TamaMapViewKt.LocationDetailsDialog (cognitive 24) app/src/main/java/com/example/llamadroid/tama/ui/TamaMapView.kt:285 — TamaMapViewKt.LocationDetailsDialog has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (23 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FarmLayoutKt.UpgradeItem (cognitive 24) · ×1
  • FarmLayoutKt.UpgradeItem (cognitive 24) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmLayout.kt:228 — FarmLayoutKt.UpgradeItem has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentWorkflowPanelsKt.QuestionSpecPanel (cognitive 24) · ×1
  • AgentWorkflowPanelsKt.QuestionSpecPanel (cognitive 24) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkflowPanels.kt:260 — AgentWorkflowPanelsKt.QuestionSpecPanel has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (22 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.
D2 · Cognitive Complexity · HarnessScreenKt.HarnessProviderCard (cognitive 24) · ×1
  • HarnessScreenKt.HarnessProviderCard (cognitive 24) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1419 — HarnessScreenKt.HarnessProviderCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NativeHarnessTurnDetailsKt.nativeHarnessUsageFromEvent (cognitive 24) · ×1
  • NativeHarnessTurnDetailsKt.nativeHarnessUsageFromEvent (cognitive 24) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnDetails.kt:704 — NativeHarnessTurnDetailsKt.nativeHarnessUsageFromEvent 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.
D2 · Cognitive Complexity · SDModelsScreenKt.inferSelectionType (cognitive 24) · ×1
  • SDModelsScreenKt.inferSelectionType (cognitive 24) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2431 — SDModelsScreenKt.inferSelectionType has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 22, if/else 1, match/switch 1. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DelegationSubagentTabKt.RowCard (cognitive 24) · ×1
  • DelegationSubagentTabKt.RowCard (cognitive 24) app/src/main/java/com/example/llamadroid/ui/ai/llama/delegation/DelegationSubagentTab.kt:128 — DelegationSubagentTabKt.RowCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, match/switch 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApprovalQueueDialogKt.StagedFileCard (cognitive 24) · ×1
  • ApprovalQueueDialogKt.StagedFileCard (cognitive 24) app/src/main/java/com/example/llamadroid/ui/components/ApprovalQueueDialog.kt:135 — ApprovalQueueDialogKt.StagedFileCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 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.
D2 · Cognitive Complexity · FileStationScreenKt.StatusSection (cognitive 24) · ×1
  • FileStationScreenKt.StatusSection (cognitive 24) app/src/main/java/com/example/llamadroid/ui/filestation/FileStationScreen.kt:236 — FileStationScreenKt.StatusSection has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (20 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.
D2 · Cognitive Complexity · LlmSavedCommandsCardKt.LlmSavedCommandsCard (cognitive 24) · ×1
  • LlmSavedCommandsCardKt.LlmSavedCommandsCard (cognitive 24) app/src/main/java/com/example/llamadroid/ui/settings/LlmSavedCommandsCard.kt:41 — LlmSavedCommandsCardKt.LlmSavedCommandsCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · MainActivityKt.localizedTamaLocationLabel (cognitive 24) · ×1
  • MainActivityKt.localizedTamaLocationLabel (cognitive 24) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:3165 — MainActivityKt.localizedTamaLocationLabel has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 18, if/else 5, match/switch 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · HarnessLocalModels.streamLlamaServer (cognitive 23) · ×1
  • HarnessLocalModels.streamLlamaServer (cognitive 23) app/src/main/java/com/example/llamadroid/harness/HarnessLocalModels.kt:723 — HarnessLocalModels.streamLlamaServer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3, loops 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessOriginalWebViewKt.authenticatedHarnessStaticResponse (cognitive 23) · ×1
  • HarnessOriginalWebViewKt.authenticatedHarnessStaticResponse (cognitive 23) app/src/main/java/com/example/llamadroid/harness/HarnessOriginalWebView.kt:208 — HarnessOriginalWebViewKt.authenticatedHarnessStaticResponse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · HarnessRuntimePresentationKt.runtimePresentation (cognitive 23) · ×1
  • HarnessRuntimePresentationKt.runtimePresentation (cognitive 23) app/src/main/java/com/example/llamadroid/harness/HarnessRuntimePresentation.kt:28 — HarnessRuntimePresentationKt.runtimePresentation has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 10, match/switch 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · HarnessTransferMappings.review (cognitive 23) · ×1
  • HarnessTransferMappings.review (cognitive 23) app/src/main/java/com/example/llamadroid/harness/HarnessTransferMappings.kt:30 — HarnessTransferMappings.review has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessRuntimeController.reconcileStaleLocked (cognitive 23) · ×1
  • HarnessRuntimeController.reconcileStaleLocked (cognitive 23) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:1171 — HarnessRuntimeController.reconcileStaleLocked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 10, error handling 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HarnessTransferConfiguration.walk (cognitive 23) · ×1
  • HarnessTransferConfiguration.walk (cognitive 23) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferConfiguration.kt:183 — HarnessTransferConfiguration.walk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentProjectControlPlane.buildControlPacket (cognitive 23) · ×1
  • AgentProjectControlPlane.buildControlPacket (cognitive 23) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:2349 — AgentProjectControlPlane.buildControlPacket has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ModelShareService.getAllLocalIpAddresses (cognitive 23) · ×1
  • ModelShareService.getAllLocalIpAddresses (cognitive 23) app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:171 — ModelShareService.getAllLocalIpAddresses has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 1 (5 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFService.detectBubbleOcrRegions (cognitive 23) · ×1
  • PDFService.detectBubbleOcrRegions (cognitive 23) app/src/main/java/com/example/llamadroid/service/PDFService.kt:5118 — PDFService.detectBubbleOcrRegions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 7, loops 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StableDiffusionService.runGenerationWithBinary (cognitive 23) · ×1
  • StableDiffusionService.runGenerationWithBinary (cognitive 23) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:797 — StableDiffusionService.runGenerationWithBinary has cognitive complexity 23 (threshold 15). Drivers by points: error handling 9, if/else 8 (9 pts), match/switch 2 (3 pts), loops 2 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZimShareService.getAllLocalIpAddresses (cognitive 23) · ×1
  • ZimShareService.getAllLocalIpAddresses (cognitive 23) app/src/main/java/com/example/llamadroid/service/ZimShareService.kt:151 — ZimShareService.getAllLocalIpAddresses has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 1 (5 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelegateSubagentToolbox.send (cognitive 23) · ×1
  • DelegateSubagentToolbox.send (cognitive 23) app/src/main/java/com/example/llamadroid/service/delegation/DelegateSubagentTools.kt:303 — DelegateSubagentToolbox.send has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GgufModelShapeReader.read (cognitive 23) · ×1
  • GgufModelShapeReader.read (cognitive 23) app/src/main/java/com/example/llamadroid/service/ram/GgufModelShapeReader.kt:25 — GgufModelShapeReader.read has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3, match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AdventureGateJournalKt.buildChronicleSection (cognitive 23) · ×1
  • AdventureGateJournalKt.buildChronicleSection (cognitive 23) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateJournal.kt:141 — AdventureGateJournalKt.buildChronicleSection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdventureGateScreenKt.SkillLoadoutTreeRow (cognitive 23) · ×1
  • AdventureGateScreenKt.SkillLoadoutTreeRow (cognitive 23) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:2407 — AdventureGateScreenKt.SkillLoadoutTreeRow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, boolean chains 9, match/switch 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentControlsKt.ConnectionStatusBar (cognitive 23) · ×1
  • AgentControlsKt.ConnectionStatusBar (cognitive 23) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:637 — AgentControlsKt.ConnectionStatusBar has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 9, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentWorkspaceScreenKt.AgentWorkspacePreviewTab (cognitive 23) · ×1
  • AgentWorkspaceScreenKt.AgentWorkspacePreviewTab (cognitive 23) app/src/main/java/com/example/llamadroid/ui/agent/AgentWorkspaceScreen.kt:2505 — AgentWorkspaceScreenKt.AgentWorkspacePreviewTab has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessRootfsFileBrowserKt.HarnessRootfsFileBrowser (cognitive 23) · ×1
  • HarnessRootfsFileBrowserKt.HarnessRootfsFileBrowser (cognitive 23) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRootfsFileBrowser.kt:70 — HarnessRootfsFileBrowserKt.HarnessRootfsFileBrowser has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, error handling 4, match/switch 3, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HarnessRuntimeTransferKt.ImportTransferBody (cognitive 23) · ×1
  • HarnessRuntimeTransferKt.ImportTransferBody (cognitive 23) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessRuntimeTransfer.kt:587 — HarnessRuntimeTransferKt.ImportTransferBody has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NativeHarnessStructuredTranscriptPanelKt.NativeHarnessStructuredTranscriptCard (cognitive 23) · ×1
  • NativeHarnessStructuredTranscriptPanelKt.NativeHarnessStructuredTranscriptCard (cognitive 23) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessStructuredTranscriptPanel.kt:43 — NativeHarnessStructuredTranscriptPanelKt.NativeHarnessStructuredTranscriptCard has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SDModelsScreenKt.SDModelsScreen (cognitive 23) · ×1
  • SDModelsScreenKt.SDModelsScreen (cognitive 23) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:185 — SDModelsScreenKt.SDModelsScreen has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 3, error handling 2 (3 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ChatDelegationServerBlocksKt.DelegationServerChoiceBlock (cognitive 23) · ×1
  • ChatDelegationServerBlocksKt.DelegationServerChoiceBlock (cognitive 23) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatDelegationServerBlocks.kt:150 — ChatDelegationServerBlocksKt.DelegationServerChoiceBlock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatDelegationSettingsSectionKt.ChatDelegationSettingsSection (cognitive 23) · ×1
  • ChatDelegationSettingsSectionKt.ChatDelegationSettingsSection (cognitive 23) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatDelegationSettingsSection.kt:72 — ChatDelegationSettingsSectionKt.ChatDelegationSettingsSection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 3, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DashboardKiwixCardKt.DashboardKiwixCard (cognitive 23) · ×1
  • DashboardKiwixCardKt.DashboardKiwixCard (cognitive 23) app/src/main/java/com/example/llamadroid/ui/dashboard/DashboardKiwixCard.kt:60 — DashboardKiwixCardKt.DashboardKiwixCard has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DynamicFeatureManager.installModule (cognitive 23) · ×1
  • DynamicFeatureManager.installModule (cognitive 23) app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:365 — DynamicFeatureManager.installModule has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AudioOutputStorage.persist (cognitive 22) · ×1
  • AudioOutputStorage.persist (cognitive 22) app/src/main/java/com/example/llamadroid/audio/AudioOutputStorage.kt:18 — AudioOutputStorage.persist has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · StableAudio3Request.validate (cognitive 22) · ×1
  • StableAudio3Request.validate (cognitive 22) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3Models.kt:278 — StableAudio3Request.validate has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 15, if/else 6 (7 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ModelRepository.downloadModel (cognitive 22) · ×1
  • ModelRepository.downloadModel (cognitive 22) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:325 — ModelRepository.downloadModel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KnowledgeBaseRepository.insertChunksFromReader (cognitive 22) · ×1
  • KnowledgeBaseRepository.insertChunksFromReader (cognitive 22) app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:1277 — KnowledgeBaseRepository.insertChunksFromReader has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessOriginalWebViewKt.scheduleHarnessWebViewBootProbe (cognitive 22) · ×1
  • HarnessOriginalWebViewKt.scheduleHarnessWebViewBootProbe (cognitive 22) app/src/main/java/com/example/llamadroid/harness/HarnessOriginalWebView.kt:338 — HarnessOriginalWebViewKt.scheduleHarnessWebViewBootProbe has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · HarnessProjectRuns.runOwned (cognitive 22) · ×1
  • HarnessProjectRuns.runOwned (cognitive 22) app/src/main/java/com/example/llamadroid/harness/HarnessProjectRuns.kt:86 — HarnessProjectRuns.runOwned has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 2 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessReferencesDialogKt.HarnessReferencesDialog (cognitive 22) · ×1
  • HarnessReferencesDialogKt.HarnessReferencesDialog (cognitive 22) app/src/main/java/com/example/llamadroid/harness/HarnessReferencesDialog.kt:40 — HarnessReferencesDialogKt.HarnessReferencesDialog has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (15 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HarnessRuntimeController.finishForceStop (cognitive 22) · ×1
  • HarnessRuntimeController.finishForceStop (cognitive 22) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:832 — HarnessRuntimeController.finishForceStop has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.packMessagesForContextOnce (cognitive 22) · ×1
  • AgentService.packMessagesForContextOnce (cognitive 22) app/src/main/java/com/example/llamadroid/service/AgentService.kt:15615 — AgentService.packMessagesForContextOnce has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 7, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentService.updatePromptContextSnapshot (cognitive 22) · ×1
  • AgentService.updatePromptContextSnapshot (cognitive 22) app/src/main/java/com/example/llamadroid/service/AgentService.kt:16299 — AgentService.updatePromptContextSnapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiteRtLeakedThinkingStreamFilter.filter (cognitive 22) · ×1
  • LiteRtLeakedThinkingStreamFilter.filter (cognitive 22) app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:2108 — LiteRtLeakedThinkingStreamFilter.filter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OllamaService.checkConnection (cognitive 22) · ×1
  • OllamaService.checkConnection (cognitive 22) app/src/main/java/com/example/llamadroid/service/OllamaService.kt:346 — OllamaService.checkConnection has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · ProcessController.setupLibrarySymlinks (cognitive 22) · ×1
  • ProcessController.setupLibrarySymlinks (cognitive 22) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:1324 — ProcessController.setupLibrarySymlinks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (6 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProcessControllerKt.filterManagedLlamaCustomFlags (cognitive 22) · ×1
  • ProcessControllerKt.filterManagedLlamaCustomFlags (cognitive 22) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:1753 — ProcessControllerKt.filterManagedLlamaCustomFlags has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · StableDiffusionService.postProcessOutputIfNeeded (cognitive 22) · ×1
  • StableDiffusionService.postProcessOutputIfNeeded (cognitive 22) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1684 — StableDiffusionService.postProcessOutputIfNeeded has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 4 (6 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessLatestPage.page (cognitive 22) · ×1
  • HarnessLatestPage.page (cognitive 22) app/src/main/java/com/example/llamadroid/service/delegation/HarnessLatestPage.kt:54 — HarnessLatestPage.page has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (22 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.
D2 · Cognitive Complexity · TamaArcadeSessions.beginArcadeSession (cognitive 22) · ×1
  • TamaArcadeSessions.beginArcadeSession (cognitive 22) app/src/main/java/com/example/llamadroid/tama/game/TamaArcadeSessions.kt:46 — TamaArcadeSessions.beginArcadeSession has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TamaGameEngine.usePotionLocked (cognitive 22) · ×1
  • TamaGameEngine.usePotionLocked (cognitive 22) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:918 — TamaGameEngine.usePotionLocked has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdventureGateArenaKt.EnemySprite (cognitive 22) · ×1
  • AdventureGateArenaKt.EnemySprite (cognitive 22) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateArena.kt:485 — AdventureGateArenaKt.EnemySprite has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, boolean chains 4, match/switch 2, loops 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.
D2 · Cognitive Complexity · AgentControlsKt.AgentContextWindowBanner (cognitive 22) · ×1
  • AgentControlsKt.AgentContextWindowBanner (cognitive 22) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:978 — AgentControlsKt.AgentContextWindowBanner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, boolean chains 4, match/switch 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LlamaSchedulerScreenKt.LlamaSchedulerScreen (cognitive 22) · ×1
  • LlamaSchedulerScreenKt.LlamaSchedulerScreen (cognitive 22) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:125 — LlamaSchedulerScreenKt.LlamaSchedulerScreen has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (20 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.
D2 · Cognitive Complexity · ServerDetailSheetKt.ServerDetailSheet (cognitive 22) · ×1
  • ServerDetailSheetKt.ServerDetailSheet (cognitive 22) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/ServerDetailSheet.kt:84 — ServerDetailSheetKt.ServerDetailSheet has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · CuratedModelBundleSectionKt.CuratedModelBundleCard (cognitive 22) · ×1
  • CuratedModelBundleSectionKt.CuratedModelBundleCard (cognitive 22) app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:517 — CuratedModelBundleSectionKt.CuratedModelBundleCard has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 3, match/switch 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · VideoUiAvailabilityKt.clearUnavailableAdvancedSelections (cognitive 22) · ×1
  • VideoUiAvailabilityKt.clearUnavailableAdvancedSelections (cognitive 22) app/src/main/java/com/example/llamadroid/ui/components/VideoUiAvailability.kt:115 — VideoUiAvailabilityKt.clearUnavailableAdvancedSelections has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AssetPackManagerUtil.extractAssetDirectory (cognitive 22) · ×1
  • AssetPackManagerUtil.extractAssetDirectory (cognitive 22) app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:146 — AssetPackManagerUtil.extractAssetDirectory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (9 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · MainActivityKt.ChatDetailScreen (cognitive 22) · ×1
  • MainActivityKt.ChatDetailScreen (cognitive 22) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1924 — MainActivityKt.ChatDetailScreen has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (20 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.
D2 · Cognitive Complexity · MainActivityKt.MonthCalendarCard (cognitive 22) · ×1
  • MainActivityKt.MonthCalendarCard (cognitive 22) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2861 — MainActivityKt.MonthCalendarCard has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 3 (9 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryRepository.legacyDeploy (cognitive 21) · ×1
  • BinaryRepository.legacyDeploy (cognitive 21) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1421 — BinaryRepository.legacyDeploy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 9). 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.
D2 · Cognitive Complexity · ModelArtifactLifecycle.deleteOwnedPathsWithProgress (cognitive 21) · ×1
  • ModelArtifactLifecycle.deleteOwnedPathsWithProgress (cognitive 21) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactLifecycle.kt:138 — ModelArtifactLifecycle.deleteOwnedPathsWithProgress has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaServerRegistryKt.mergeUnifiedServers (cognitive 21) · ×1
  • LlamaServerRegistryKt.mergeUnifiedServers (cognitive 21) app/src/main/java/com/example/llamadroid/data/repository/LlamaServerRegistry.kt:87 — LlamaServerRegistryKt.mergeUnifiedServers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessProjectManagement.loadGroup (cognitive 21) · ×1
  • HarnessProjectManagement.loadGroup (cognitive 21) app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:539 — HarnessProjectManagement.loadGroup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 8 (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.
D2 · Cognitive Complexity · HarnessTerminalDialogKt.HarnessTerminalDialog (cognitive 21) · ×1
  • HarnessTerminalDialogKt.HarnessTerminalDialog (cognitive 21) app/src/main/java/com/example/llamadroid/harness/HarnessTerminalDialog.kt:39 — HarnessTerminalDialogKt.HarnessTerminalDialog has cognitive complexity 21 (threshold 15). Drivers by points: error handling 6 (8 pts), if/else 7, boolean chains 5, loops 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.fetchUrl (cognitive 21) · ×1
  • AgentService.fetchUrl (cognitive 21) app/src/main/java/com/example/llamadroid/service/AgentService.kt:18401 — AgentService.fetchUrl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFTranslationJobService.startTextLayerPdfTranslationBatch (cognitive 21) · ×1
  • PDFTranslationJobService.startTextLayerPdfTranslationBatch (cognitive 21) app/src/main/java/com/example/llamadroid/service/PDFTranslationJobService.kt:103 — PDFTranslationJobService.startTextLayerPdfTranslationBatch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 3, error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PDFTranslationLogic.extractFlexibleTranslations (cognitive 21) · ×1
  • PDFTranslationLogic.extractFlexibleTranslations (cognitive 21) app/src/main/java/com/example/llamadroid/service/PDFTranslationLogic.kt:528 — PDFTranslationLogic.extractFlexibleTranslations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 3 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoteMasterServer.handleDownload (cognitive 21) · ×1
  • RemoteMasterServer.handleDownload (cognitive 21) app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:517 — RemoteMasterServer.handleDownload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 3 (4 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.
D2 · Cognitive Complexity · SSHService.executeCommandStreaming (cognitive 21) · ×1
  • SSHService.executeCommandStreaming (cognitive 21) app/src/main/java/com/example/llamadroid/service/SSHService.kt:615 — SSHService.executeCommandStreaming has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 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.
D2 · Cognitive Complexity · SSHService.startToolLogTail (cognitive 21) · ×1
  • SSHService.startToolLogTail (cognitive 21) app/src/main/java/com/example/llamadroid/service/SSHService.kt:771 — SSHService.startToolLogTail has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), error handling 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoGenerationService.onStartCommand (cognitive 21) · ×1
  • VideoGenerationService.onStartCommand (cognitive 21) app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:91 — VideoGenerationService.onStartCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FarmPetBrain.step (cognitive 21) · ×1
  • FarmPetBrain.step (cognitive 21) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmAmbientModel.kt:131 — FarmPetBrain.step has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessScreenKt.HarnessSessionCard (cognitive 21) · ×1
  • HarnessScreenKt.HarnessSessionCard (cognitive 21) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessScreen.kt:1210 — HarnessScreenKt.HarnessSessionCard has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PageReader.read (cognitive 21) · ×1
  • PageReader.read (cognitive 21) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessTurnActions.kt:396 — PageReader.read has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SDModelsScreenKt.installedCapabilitiesFor (cognitive 21) · ×1
  • SDModelsScreenKt.installedCapabilitiesFor (cognitive 21) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2541 — SDModelsScreenKt.installedCapabilitiesFor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · WorkflowsScreenKt.MediaDubbingTranslationWorkflowContent (cognitive 21) · ×1
  • WorkflowsScreenKt.MediaDubbingTranslationWorkflowContent (cognitive 21) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4734 — WorkflowsScreenKt.MediaDubbingTranslationWorkflowContent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, error handling 3, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ChatComposerKt.ChatComposer (cognitive 21) · ×1
  • ChatComposerKt.ChatComposer (cognitive 21) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatComposer.kt:144 — ChatComposerKt.ChatComposer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ChatSettingsSectionsKt.KnowledgeBaseSection (cognitive 21) · ×1
  • ChatSettingsSectionsKt.KnowledgeBaseSection (cognitive 21) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsSections.kt:479 — ChatSettingsSectionsKt.KnowledgeBaseSection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (21 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AudioWorkspaceModelsKt.validationErrors (cognitive 21) · ×1
  • AudioWorkspaceModelsKt.validationErrors (cognitive 21) app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceModels.kt:304 — AudioWorkspaceModelsKt.validationErrors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 10 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AudioWorkspaceRuntimeController.toUiModel (cognitive 21) · ×1
  • AudioWorkspaceRuntimeController.toUiModel (cognitive 21) app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceRuntimeController.kt:671 — AudioWorkspaceRuntimeController.toUiModel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 3, match/switch 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · dialogs.h (cognitive 21) · ×1
  • dialogs.h (cognitive 21) app/src/main/assets/file_station_webui/js/dialogs.js:4 — dialogs.h has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SettingsRepository.migrateDirectAgentSettingsPreferences (cognitive 20) · ×1
  • SettingsRepository.migrateDirectAgentSettingsPreferences (cognitive 20) app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:245 — SettingsRepository.migrateDirectAgentSettingsPreferences has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BinaryRepository.getSelectedNativeBinary (cognitive 20) · ×1
  • BinaryRepository.getSelectedNativeBinary (cognitive 20) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:700 — BinaryRepository.getSelectedNativeBinary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · TermuxTools.getRunCommand (cognitive 20) · ×1
  • TermuxTools.getRunCommand (cognitive 20) app/src/main/java/com/example/llamadroid/data/model/TermuxTools.kt:713 — TermuxTools.getRunCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 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.
D2 · Cognitive Complexity · ProotManager.extractRootfs (cognitive 20) · ×1
  • ProotManager.extractRootfs (cognitive 20) app/src/main/java/com/example/llamadroid/data/proot/ProotManager.kt:111 — ProotManager.extractRootfs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (4 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessPromptNormalizer.normalize (cognitive 20) · ×1
  • HarnessPromptNormalizer.normalize (cognitive 20) app/src/main/java/com/example/llamadroid/harness/HarnessPromptNormalizer.kt:51 — HarnessPromptNormalizer.normalize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (5 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HarnessWorkspaceAccess.invoke (cognitive 20) · ×1
  • HarnessWorkspaceAccess.invoke (cognitive 20) app/src/main/java/com/example/llamadroid/harness/HarnessWorkspaceAccess.kt:111 — HarnessWorkspaceAccess.invoke has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · OkHttpHarnessClient.callWithPolicy (cognitive 20) · ×1
  • OkHttpHarnessClient.callWithPolicy (cognitive 20) app/src/main/java/com/example/llamadroid/harness/client/OkHttpHarnessClient.kt:223 — OkHttpHarnessClient.callWithPolicy has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · AgentProjectControlPlane.classifyVerificationCheck (cognitive 20) · ×1
  • AgentProjectControlPlane.classifyVerificationCheck (cognitive 20) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:403 — AgentProjectControlPlane.classifyVerificationCheck has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (10 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AgentProjectControlPlane.applyVerificationResult (cognitive 20) · ×1
  • AgentProjectControlPlane.applyVerificationResult (cognitive 20) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:697 — AgentProjectControlPlane.applyVerificationResult has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, match/switch 3 (5 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentService.writeMemory (cognitive 20) · ×1
  • AgentService.writeMemory (cognitive 20) app/src/main/java/com/example/llamadroid/service/AgentService.kt:20069 — AgentService.writeMemory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 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. This shape REPEATS in the file: one other method here (AgentService.rewriteMemory) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · AgentService.rewriteMemory (cognitive 20) · ×1
  • AgentService.rewriteMemory (cognitive 20) app/src/main/java/com/example/llamadroid/service/AgentService.kt:20136 — AgentService.rewriteMemory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 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. This shape REPEATS in the file: one other method here (AgentService.writeMemory) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · AgentService.kiwixSearch (cognitive 20) · ×1
  • AgentService.kiwixSearch (cognitive 20) app/src/main/java/com/example/llamadroid/service/AgentService.kt:20676 — AgentService.kiwixSearch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolHttpServer.startImageJob (cognitive 20) · ×1
  • ToolHttpServer.startImageJob (cognitive 20) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:729 — ToolHttpServer.startImageJob has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LlamaServerSessionRuntime.start (cognitive 20) · ×1
  • LlamaServerSessionRuntime.start (cognitive 20) app/src/main/java/com/example/llamadroid/service/LlamaServerSessionRuntime.kt:175 — LlamaServerSessionRuntime.start has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFSummaryLogic.splitOversizedSegment (cognitive 20) · ×1
  • PDFSummaryLogic.splitOversizedSegment (cognitive 20) app/src/main/java/com/example/llamadroid/service/PDFSummaryLogic.kt:329 — PDFSummaryLogic.splitOversizedSegment has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoteMasterServer.handleSpeculative (cognitive 20) · ×1
  • RemoteMasterServer.handleSpeculative (cognitive 20) app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:455 — RemoteMasterServer.handleSpeculative has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StableDiffusionService.onStartCommand (cognitive 20) · ×1
  • StableDiffusionService.onStartCommand (cognitive 20) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:176 — StableDiffusionService.onStartCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 4). 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.
D2 · Cognitive Complexity · TamaDailyDreamManager.buildDreamPlan (cognitive 20) · ×1
  • TamaDailyDreamManager.buildDreamPlan (cognitive 20) app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:365 — TamaDailyDreamManager.buildDreamPlan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 6 (8 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TamaDailyDreamManager.fetchBackendMetadataWithConnectionLimit (cognitive 20) · ×1
  • TamaDailyDreamManager.fetchBackendMetadataWithConnectionLimit (cognitive 20) app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:851 — TamaDailyDreamManager.fetchBackendMetadataWithConnectionLimit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TamaDailyDreamManager.extractDreamTextValue (cognitive 20) · ×1
  • TamaDailyDreamManager.extractDreamTextValue (cognitive 20) app/src/main/java/com/example/llamadroid/tama/game/TamaDailyDreamManager.kt:1190 — TamaDailyDreamManager.extractDreamTextValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (3 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TamaDeepDreamRunCoordinator.reconcileAlbumState (cognitive 20) · ×1
  • TamaDeepDreamRunCoordinator.reconcileAlbumState (cognitive 20) app/src/main/java/com/example/llamadroid/tama/game/TamaDeepDreamRunCoordinator.kt:392 — TamaDeepDreamRunCoordinator.reconcileAlbumState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessGoalPanelKt.HarnessGoalPanel (cognitive 20) · ×1
  • HarnessGoalPanelKt.HarnessGoalPanel (cognitive 20) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessGoalPanel.kt:27 — HarnessGoalPanelKt.HarnessGoalPanel has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OnnxTtsGalleryScreenKt.OnnxTtsGalleryScreen (cognitive 20) · ×1
  • OnnxTtsGalleryScreenKt.OnnxTtsGalleryScreen (cognitive 20) app/src/main/java/com/example/llamadroid/ui/ai/OnnxTtsGalleryScreen.kt:74 — OnnxTtsGalleryScreenKt.OnnxTtsGalleryScreen has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, 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.
D2 · Cognitive Complexity · VideoGenScreenKt.buildVideoGenerationInfoText (cognitive 20) · ×1
  • VideoGenScreenKt.buildVideoGenerationInfoText (cognitive 20) app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:2389 — VideoGenScreenKt.buildVideoGenerationInfoText has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ChatSettingsGroupsKt.ChatSettingsGroupList (cognitive 20) · ×1
  • ChatSettingsGroupsKt.ChatSettingsGroupList (cognitive 20) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsGroups.kt:41 — ChatSettingsGroupsKt.ChatSettingsGroupList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (18 pts), 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.
D2 · Cognitive Complexity · VideoInputPickerKt.importVideoFrameDirectory (cognitive 20) · ×1
  • VideoInputPickerKt.importVideoFrameDirectory (cognitive 20) app/src/main/java/com/example/llamadroid/ui/components/VideoInputPicker.kt:200 — VideoInputPickerKt.importVideoFrameDirectory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EasyModelImporterKt.EasyModelImportSection (cognitive 20) · ×1
  • EasyModelImporterKt.EasyModelImportSection (cognitive 20) app/src/main/java/com/example/llamadroid/ui/easy/EasyModelImporter.kt:294 — EasyModelImporterKt.EasyModelImportSection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, match/switch 3, boolean chains 2, error handling 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ModelPromotionDialogKt.PromoteArtifactDialog (cognitive 20) · ×1
  • ModelPromotionDialogKt.PromoteArtifactDialog (cognitive 20) app/src/main/java/com/example/llamadroid/ui/models/ModelPromotionDialog.kt:54 — ModelPromotionDialogKt.PromoteArtifactDialog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · WearCompanionStore.sendRpc (cognitive 20) · ×1
  • WearCompanionStore.sendRpc (cognitive 20) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1090 — WearCompanionStore.sendRpc has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ModelSourceRepository.promotePendingArtifact (cognitive 19) · ×1
  • ModelSourceRepository.promotePendingArtifact (cognitive 19) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1994 — ModelSourceRepository.promotePendingArtifact has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentPreviewObservation.toJson (cognitive 19) · ×1
  • AgentPreviewObservation.toJson (cognitive 19) app/src/main/java/com/example/llamadroid/service/AgentPreviewBridge.kt:68 — AgentPreviewObservation.toJson has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · AgentProjectControlPlane.todoOutcomeForReport (cognitive 19) · ×1
  • AgentProjectControlPlane.todoOutcomeForReport (cognitive 19) app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:3142 — AgentProjectControlPlane.todoOutcomeForReport has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 2, boolean chains 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.
D2 · Cognitive Complexity · AgentService.listDirectory (cognitive 19) · ×1
  • AgentService.listDirectory (cognitive 19) app/src/main/java/com/example/llamadroid/service/AgentService.kt:1425 — AgentService.listDirectory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, match/switch 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.addMessage (cognitive 19) · ×1
  • AgentService.addMessage (cognitive 19) app/src/main/java/com/example/llamadroid/service/AgentService.kt:6635 — AgentService.addMessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AiServerNetwork.localIpv4Addresses (cognitive 19) · ×1
  • AiServerNetwork.localIpv4Addresses (cognitive 19) app/src/main/java/com/example/llamadroid/service/AiServerSupport.kt:147 — AiServerNetwork.localIpv4Addresses has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolHttpServer.watchDatasetJob (cognitive 19) · ×1
  • ToolHttpServer.watchDatasetJob (cognitive 19) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:2520 — ToolHttpServer.watchDatasetJob has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomToolHttpExecutor.prepare (cognitive 19) · ×1
  • CustomToolHttpExecutor.prepare (cognitive 19) app/src/main/java/com/example/llamadroid/service/CustomToolHttpExecutor.kt:47 — CustomToolHttpExecutor.prepare has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadService.cancelDownloadInternal (cognitive 19) · ×1
  • DownloadService.cancelDownloadInternal (cognitive 19) app/src/main/java/com/example/llamadroid/service/DownloadService.kt:1204 — DownloadService.cancelDownloadInternal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaServerChatService.chatWithToolsStreaming (cognitive 19) · ×1
  • LlamaServerChatService.chatWithToolsStreaming (cognitive 19) app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt:357 — LlamaServerChatService.chatWithToolsStreaming has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, error handling 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NativeChatLocalServerStarter.waitForHealth (cognitive 19) · ×1
  • NativeChatLocalServerStarter.waitForHealth (cognitive 19) app/src/main/java/com/example/llamadroid/service/NativeChatLocalServerStarter.kt:256 — NativeChatLocalServerStarter.waitForHealth has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeCalculatorParser.parseNumber (cognitive 19) · ×1
  • NativeCalculatorParser.parseNumber (cognitive 19) app/src/main/java/com/example/llamadroid/service/NativeChatTools.kt:4160 — NativeCalculatorParser.parseNumber has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (6 pts), loops 3 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OllamaService.chat (cognitive 19) · ×1
  • OllamaService.chat (cognitive 19) app/src/main/java/com/example/llamadroid/service/OllamaService.kt:692 — OllamaService.chat has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 3 (5 pts), error handling 3 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PDFService.compressPdf (cognitive 19) · ×1
  • PDFService.compressPdf (cognitive 19) app/src/main/java/com/example/llamadroid/service/PDFService.kt:7679 — PDFService.compressPdf has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 5 (8 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProcessController.appendVideoArgsIfNeeded (cognitive 19) · ×1
  • ProcessController.appendVideoArgsIfNeeded (cognitive 19) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:758 — ProcessController.appendVideoArgsIfNeeded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuadtrixTrainingService.handleProgressClient (cognitive 19) · ×1
  • QuadtrixTrainingService.handleProgressClient (cognitive 19) app/src/main/java/com/example/llamadroid/service/QuadtrixTrainingService.kt:751 — QuadtrixTrainingService.handleProgressClient has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoSumupService.transcribe (cognitive 19) · ×1
  • VideoSumupService.transcribe (cognitive 19) app/src/main/java/com/example/llamadroid/service/VideoSumupService.kt:436 — VideoSumupService.transcribe has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), error handling 4, 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.
D2 · Cognitive Complexity · DelegationManager.messageSubagent (cognitive 19) · ×1
  • DelegationManager.messageSubagent (cognitive 19) app/src/main/java/com/example/llamadroid/service/delegation/DelegationManager.kt:185 — DelegationManager.messageSubagent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HarnessTaskDigest.encode (cognitive 19) · ×1
  • HarnessTaskDigest.encode (cognitive 19) app/src/main/java/com/example/llamadroid/service/delegation/HarnessTaskDigest.kt:337 — HarnessTaskDigest.encode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18 (19 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · EditorApi.save (cognitive 19) · ×1
  • EditorApi.save (cognitive 19) app/src/main/java/com/example/llamadroid/service/filestation/api/EditorApi.kt:81 — EditorApi.save has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FsWriteApi.transfer (cognitive 19) · ×1
  • FsWriteApi.transfer (cognitive 19) app/src/main/java/com/example/llamadroid/service/filestation/api/FsWriteApi.kt:95 — FsWriteApi.transfer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TitleGenerationManager.processBatch (cognitive 19) · ×1
  • TitleGenerationManager.processBatch (cognitive 19) app/src/main/java/com/example/llamadroid/service/titlegen/TitleGenerationManager.kt:183 — TitleGenerationManager.processBatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 2 (3 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.
D2 · Cognitive Complexity · TamaAgentService.retryConnection (cognitive 19) · ×1
  • TamaAgentService.retryConnection (cognitive 19) app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:899 — TamaAgentService.retryConnection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TamaGameEngine.travelToClassicLocked (cognitive 19) · ×1
  • TamaGameEngine.travelToClassicLocked (cognitive 19) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2016 — TamaGameEngine.travelToClassicLocked has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (17 pts), 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.
D2 · Cognitive Complexity · TamaMemorySupportKt.extractFirstJsonObject (cognitive 19) · ×1
  • TamaMemorySupportKt.extractFirstJsonObject (cognitive 19) app/src/main/java/com/example/llamadroid/tama/game/TamaMemorySupport.kt:189 — TamaMemorySupportKt.extractFirstJsonObject has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TamaMemorySupportKt.extractFirstJsonArray) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · TamaMemorySupportKt.extractFirstJsonArray (cognitive 19) · ×1
  • TamaMemorySupportKt.extractFirstJsonArray (cognitive 19) app/src/main/java/com/example/llamadroid/tama/game/TamaMemorySupport.kt:216 — TamaMemorySupportKt.extractFirstJsonArray has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TamaMemorySupportKt.extractFirstJsonObject) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · AdventureGateScreenKt.AdventureGateShopDialog (cognitive 19) · ×1
  • AdventureGateScreenKt.AdventureGateShopDialog (cognitive 19) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1193 — AdventureGateScreenKt.AdventureGateShopDialog has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FarmTilesKt.FarmTileItem (cognitive 19) · ×1
  • FarmTilesKt.FarmTileItem (cognitive 19) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmTiles.kt:75 — FarmTilesKt.FarmTileItem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FarmToolBarKt.FarmToolCell (cognitive 19) · ×1
  • FarmToolBarKt.FarmToolCell (cognitive 19) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmToolBar.kt:159 — FarmToolBarKt.FarmToolCell has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TamaPairedAddressKt.parseManualAddress (cognitive 19) · ×1
  • TamaPairedAddressKt.parseManualAddress (cognitive 19) app/src/main/java/com/example/llamadroid/tama/ui/transfer/TamaPairedAddress.kt:14 — TamaPairedAddressKt.parseManualAddress has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentCoordinationSupportKt.shouldSurfaceColdRecovery (cognitive 19) · ×1
  • AgentCoordinationSupportKt.shouldSurfaceColdRecovery (cognitive 19) app/src/main/java/com/example/llamadroid/ui/agent/AgentCoordinationSupport.kt:113 — AgentCoordinationSupportKt.shouldSurfaceColdRecovery has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 9, match/switch 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AgentSkillManagerKt.AgentSkillManagerDialog (cognitive 19) · ×1
  • AgentSkillManagerKt.AgentSkillManagerDialog (cognitive 19) app/src/main/java/com/example/llamadroid/ui/agent/AgentSkillManager.kt:66 — AgentSkillManagerKt.AgentSkillManagerDialog has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessQueuePanelKt.HarnessQueueCard (cognitive 19) · ×1
  • HarnessQueuePanelKt.HarnessQueueCard (cognitive 19) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessQueuePanel.kt:30 — HarnessQueuePanelKt.HarnessQueueCard has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessWorkspaceNavigationKt.HarnessProjectsLanding (cognitive 19) · ×1
  • HarnessWorkspaceNavigationKt.HarnessProjectsLanding (cognitive 19) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessWorkspaceNavigation.kt:241 — HarnessWorkspaceNavigationKt.HarnessProjectsLanding has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (19 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GenerationQueueScreenKt.GenerationQueueScreen (cognitive 19) · ×1
  • GenerationQueueScreenKt.GenerationQueueScreen (cognitive 19) app/src/main/java/com/example/llamadroid/ui/ai/GenerationQueueScreen.kt:88 — GenerationQueueScreenKt.GenerationQueueScreen has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ImageGenScreenKt.buildImageGenerationHelpSections (cognitive 19) · ×1
  • ImageGenScreenKt.buildImageGenerationHelpSections (cognitive 19) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5061 — ImageGenScreenKt.buildImageGenerationHelpSections has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 pts), match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ChatKvCacheSectionKt.ChatKvCacheSection (cognitive 19) · ×1
  • ChatKvCacheSectionKt.ChatKvCacheSection (cognitive 19) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatKvCacheSection.kt:45 — ChatKvCacheSectionKt.ChatKvCacheSection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ChatMessageAttachmentsKt.AttachmentChip (cognitive 19) · ×1
  • ChatMessageAttachmentsKt.AttachmentChip (cognitive 19) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageAttachments.kt:185 — ChatMessageAttachmentsKt.AttachmentChip has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (17 pts), 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.
D2 · Cognitive Complexity · DownloadTaskSectionKt.DownloadTaskCard (cognitive 19) · ×1
  • DownloadTaskSectionKt.DownloadTaskCard (cognitive 19) app/src/main/java/com/example/llamadroid/ui/components/DownloadTaskSection.kt:237 — DownloadTaskSectionKt.DownloadTaskCard has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DashboardScreenKt.DashboardScreen (cognitive 19) · ×1
  • DashboardScreenKt.DashboardScreen (cognitive 19) app/src/main/java/com/example/llamadroid/ui/dashboard/DashboardScreen.kt:112 — DashboardScreenKt.DashboardScreen has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · EasyChatOptionsSheetKt.EasyChatOptionsSheet (cognitive 19) · ×1
  • EasyChatOptionsSheetKt.EasyChatOptionsSheet (cognitive 19) app/src/main/java/com/example/llamadroid/ui/easy/EasyChatOptionsSheet.kt:74 — EasyChatOptionsSheetKt.EasyChatOptionsSheet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DynamicFeatureManager.installOptionalAccelerators (cognitive 19) · ×1
  • DynamicFeatureManager.installOptionalAccelerators (cognitive 19) app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:263 — DynamicFeatureManager.installOptionalAccelerators has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · WearCompanionBridgeManager.routeCommand (cognitive 19) · ×1
  • WearCompanionBridgeManager.routeCommand (cognitive 19) app/src/main/java/com/example/llamadroid/wear/WearCompanionBridgeManager.kt:362 — WearCompanionBridgeManager.routeCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · browser.loadDir (cognitive 19) · ×1
  • browser.loadDir (cognitive 19) app/src/main/assets/file_station_webui/js/browser.js:52 — browser.loadDir has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AudioGenerationService.localizeError (cognitive 18) · ×1
  • AudioGenerationService.localizeError (cognitive 18) app/src/main/java/com/example/llamadroid/audio/AudioGenerationService.kt:537 — AudioGenerationService.localizeError has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 16, if/else 1, match/switch 1. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AudioGenerationRequest.normalized (cognitive 18) · ×1
  • AudioGenerationRequest.normalized (cognitive 18) app/src/main/java/com/example/llamadroid/audio/AudioModels.kt:146 — AudioGenerationRequest.normalized has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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.
D2 · Cognitive Complexity · AudioLibraryRepository.deleteFolderContents (cognitive 18) · ×1
  • AudioLibraryRepository.deleteFolderContents (cognitive 18) app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:446 — AudioLibraryRepository.deleteFolderContents has cognitive complexity 18 (threshold 15). Drivers by points: error handling 6 (12 pts), if/else 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LocalModelImportsKt.importSDModel (cognitive 18) · ×1
  • LocalModelImportsKt.importSDModel (cognitive 18) app/src/main/java/com/example/llamadroid/data/model/LocalModelImports.kt:22 — LocalModelImportsKt.importSDModel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 1 (2 pts), error handling 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelRepository.previewDeleteModel (cognitive 18) · ×1
  • ModelRepository.previewDeleteModel (cognitive 18) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:757 — ModelRepository.previewDeleteModel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ModelArtifactRecognizer.validateSd (cognitive 18) · ×1
  • ModelArtifactRecognizer.validateSd (cognitive 18) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactRecognizer.kt:283 — ModelArtifactRecognizer.validateSd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ModelSourceRepository.resumePendingCustomDownloads (cognitive 18) · ×1
  • ModelSourceRepository.resumePendingCustomDownloads (cognitive 18) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1754 — ModelSourceRepository.resumePendingCustomDownloads has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 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.
D2 · Cognitive Complexity · HarnessAppRuntime.startOwned (cognitive 18) · ×1
  • HarnessAppRuntime.startOwned (cognitive 18) app/src/main/java/com/example/llamadroid/harness/HarnessAppRuntime.kt:285 — HarnessAppRuntime.startOwned has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · HarnessAppRuntime.monitorOwnership (cognitive 18) · ×1
  • HarnessAppRuntime.monitorOwnership (cognitive 18) app/src/main/java/com/example/llamadroid/harness/HarnessAppRuntime.kt:550 — HarnessAppRuntime.monitorOwnership has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessBridgeOperations.image (cognitive 18) · ×1
  • HarnessBridgeOperations.image (cognitive 18) app/src/main/java/com/example/llamadroid/harness/HarnessBridgeOperations.kt:416 — HarnessBridgeOperations.image has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HarnessCompletionAccumulator.add (cognitive 18) · ×1
  • HarnessCompletionAccumulator.add (cognitive 18) app/src/main/java/com/example/llamadroid/harness/HarnessCompletionAccumulator.kt:18 — HarnessCompletionAccumulator.add has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OkHttpHarnessClient.fetchJson (cognitive 18) · ×1
  • OkHttpHarnessClient.fetchJson (cognitive 18) app/src/main/java/com/example/llamadroid/harness/client/OkHttpHarnessClient.kt:289 — OkHttpHarnessClient.fetchJson has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 4, error handling 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.
D2 · Cognitive Complexity · HarnessRuntimeController.recover (cognitive 18) · ×1
  • HarnessRuntimeController.recover (cognitive 18) app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeController.kt:235 — HarnessRuntimeController.recover has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 6, error handling 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ClipBpeTokenizer.applyBpe (cognitive 18) · ×1
  • ClipBpeTokenizer.applyBpe (cognitive 18) app/src/main/java/com/example/llamadroid/onnx/ClipBpeTokenizer.kt:100 — ClipBpeTokenizer.applyBpe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OnnxBackgroundRemovalSupportKt.extractMaskFromValues (cognitive 18) · ×1
  • OnnxBackgroundRemovalSupportKt.extractMaskFromValues (cognitive 18) app/src/main/java/com/example/llamadroid/onnx/OnnxBackgroundRemovalSupport.kt:539 — OnnxBackgroundRemovalSupportKt.extractMaskFromValues has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdModelSupportKt.inferSdVariant (cognitive 18) · ×1
  • SdModelSupportKt.inferSdVariant (cognitive 18) app/src/main/java/com/example/llamadroid/sd/SdModelSupport.kt:607 — SdModelSupportKt.inferSdVariant has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, match/switch 3 (5 pts), if/else 3 (nesting depth added 2). 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.
D2 · Cognitive Complexity · AgentDurableContractStore.answerQuestionAtomically (cognitive 18) · ×1
  • AgentDurableContractStore.answerQuestionAtomically (cognitive 18) app/src/main/java/com/example/llamadroid/service/AgentDurableContractStore.kt:1430 — AgentDurableContractStore.answerQuestionAtomically has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentPlanProposalRecoveryKt.recoverImplementationPlanProse (cognitive 18) · ×1
  • AgentPlanProposalRecoveryKt.recoverImplementationPlanProse (cognitive 18) app/src/main/java/com/example/llamadroid/service/AgentPlanProposalRecovery.kt:91 — AgentPlanProposalRecoveryKt.recoverImplementationPlanProse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentRuntimeSupport.resolveFinishTaskPayload (cognitive 18) · ×1
  • AgentRuntimeSupport.resolveFinishTaskPayload (cognitive 18) app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:1954 — AgentRuntimeSupport.resolveFinishTaskPayload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 4, match/switch 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentService.restorePersistentState (cognitive 18) · ×1
  • AgentService.restorePersistentState (cognitive 18) app/src/main/java/com/example/llamadroid/service/AgentService.kt:1019 — AgentService.restorePersistentState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.applyPatch (cognitive 18) · ×1
  • AgentService.applyPatch (cognitive 18) app/src/main/java/com/example/llamadroid/service/AgentService.kt:19223 — AgentService.applyPatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.buildToolsReferenceContent (cognitive 18) · ×1
  • AgentService.buildToolsReferenceContent (cognitive 18) app/src/main/java/com/example/llamadroid/service/AgentService.kt:8029 — AgentService.buildToolsReferenceContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KiwixService.startServer (cognitive 18) · ×1
  • KiwixService.startServer (cognitive 18) app/src/main/java/com/example/llamadroid/service/KiwixService.kt:90 — KiwixService.startServer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LiteRtLmWorkerClient.streamBackendChat (cognitive 18) · ×1
  • LiteRtLmWorkerClient.streamBackendChat (cognitive 18) app/src/main/java/com/example/llamadroid/service/LiteRtLmWorkerService.kt:843 — LiteRtLmWorkerClient.streamBackendChat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LlamaModelMetadataProbe.probe (cognitive 18) · ×1
  • LlamaModelMetadataProbe.probe (cognitive 18) app/src/main/java/com/example/llamadroid/service/LlamaModelMetadataProbe.kt:51 — LlamaModelMetadataProbe.probe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (4 pts), error handling 2, loops 2, 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.
D2 · Cognitive Complexity · LlamaServerChatServiceKt.buildLlamaServerChatRequestPayload (cognitive 18) · ×1
  • LlamaServerChatServiceKt.buildLlamaServerChatRequestPayload (cognitive 18) app/src/main/java/com/example/llamadroid/service/LlamaServerChatService.kt:992 — LlamaServerChatServiceKt.buildLlamaServerChatRequestPayload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · MediaTranslationWorkflowService.startMediaQueue (cognitive 18) · ×1
  • MediaTranslationWorkflowService.startMediaQueue (cognitive 18) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1171 — MediaTranslationWorkflowService.startMediaQueue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (MediaTranslationWorkflowService.startSubtitleQueue) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · MediaTranslationWorkflowService.startSubtitleQueue (cognitive 18) · ×1
  • MediaTranslationWorkflowService.startSubtitleQueue (cognitive 18) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1299 — MediaTranslationWorkflowService.startSubtitleQueue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (MediaTranslationWorkflowService.startMediaQueue) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · PDFService.extractTextDetailed (cognitive 18) · ×1
  • PDFService.extractTextDetailed (cognitive 18) app/src/main/java/com/example/llamadroid/service/PDFService.kt:472 — PDFService.extractTextDetailed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 1 (3 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFService.splitBySize (cognitive 18) · ×1
  • PDFService.splitBySize (cognitive 18) app/src/main/java/com/example/llamadroid/service/PDFService.kt:7772 — PDFService.splitBySize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFSummaryLogic.splitIntoChunks (cognitive 18) · ×1
  • PDFSummaryLogic.splitIntoChunks (cognitive 18) app/src/main/java/com/example/llamadroid/service/PDFSummaryLogic.kt:99 — PDFSummaryLogic.splitIntoChunks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdLaunchPreflightKt.resolveSdPipelineForLaunch (cognitive 18) · ×1
  • SdLaunchPreflightKt.resolveSdPipelineForLaunch (cognitive 18) app/src/main/java/com/example/llamadroid/service/SdLaunchPreflight.kt:30 — SdLaunchPreflightKt.resolveSdPipelineForLaunch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, match/switch 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.
D2 · Cognitive Complexity · SdRuntimeSupportKt.setupSdLibrarySymlinks (cognitive 18) · ×1
  • SdRuntimeSupportKt.setupSdLibrarySymlinks (cognitive 18) app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:235 — SdRuntimeSupportKt.setupSdLibrarySymlinks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (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.
D2 · Cognitive Complexity · TamaDeepDreamService.runDeepDream (cognitive 18) · ×1
  • TamaDeepDreamService.runDeepDream (cognitive 18) app/src/main/java/com/example/llamadroid/service/TamaDeepDreamService.kt:99 — TamaDeepDreamService.runDeepDream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 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.
D2 · Cognitive Complexity · VideoInterpolationService.onStartCommand (cognitive 18) · ×1
  • VideoInterpolationService.onStartCommand (cognitive 18) app/src/main/java/com/example/llamadroid/service/VideoInterpolationService.kt:65 — VideoInterpolationService.onStartCommand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, match/switch 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.
D2 · Cognitive Complexity · VideoInterpolationService.runRife (cognitive 18) · ×1
  • VideoInterpolationService.runRife (cognitive 18) app/src/main/java/com/example/llamadroid/service/VideoInterpolationService.kt:555 — VideoInterpolationService.runRife has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, loops 2, error handling 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DelegateHarnessDriver.followLoop (cognitive 18) · ×1
  • DelegateHarnessDriver.followLoop (cognitive 18) app/src/main/java/com/example/llamadroid/service/delegation/DelegateHarnessDriver.kt:612 — DelegateHarnessDriver.followLoop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (6 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · ToolSpec.parse (cognitive 18) · ×1
  • ToolSpec.parse (cognitive 18) app/src/main/java/com/example/llamadroid/service/filestation/api/ToolsApi.kt:456 — ToolSpec.parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ShimejiMotion.chooseNext (cognitive 18) · ×1
  • ShimejiMotion.chooseNext (cognitive 18) app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiMotion.kt:328 — ShimejiMotion.chooseNext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AdventureGateStoryUiKt.AdventureGateStoryOverlay (cognitive 18) · ×1
  • AdventureGateStoryUiKt.AdventureGateStoryOverlay (cognitive 18) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateStoryUi.kt:315 — AdventureGateStoryUiKt.AdventureGateStoryOverlay has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 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.
D2 · Cognitive Complexity · AgentChatListKt.AgentChatList (cognitive 18) · ×1
  • AgentChatListKt.AgentChatList (cognitive 18) app/src/main/java/com/example/llamadroid/ui/agent/AgentChatList.kt:372 — AgentChatListKt.AgentChatList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessCommandsTabKt.HarnessCommandRunCard (cognitive 18) · ×1
  • HarnessCommandsTabKt.HarnessCommandRunCard (cognitive 18) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessCommandsTab.kt:157 — HarnessCommandsTabKt.HarnessCommandRunCard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, match/switch 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessInlineLinksKt.parseHarnessInlineDestination (cognitive 18) · ×1
  • HarnessInlineLinksKt.parseHarnessInlineDestination (cognitive 18) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessInlineLinks.kt:18 — HarnessInlineLinksKt.parseHarnessInlineDestination has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AIHubScreenKt.ToolsTab (cognitive 18) · ×1
  • AIHubScreenKt.ToolsTab (cognitive 18) app/src/main/java/com/example/llamadroid/ui/ai/AIHubScreen.kt:135 — AIHubScreenKt.ToolsTab has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 4, 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.
D2 · Cognitive Complexity · ImageGenScreenKt.SdParamsBackendProfileControls (cognitive 18) · ×1
  • ImageGenScreenKt.SdParamsBackendProfileControls (cognitive 18) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4848 — ImageGenScreenKt.SdParamsBackendProfileControls has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssetDownloadDialogKt.AssetDownloadDialog (cognitive 18) · ×1
  • AssetDownloadDialogKt.AssetDownloadDialog (cognitive 18) app/src/main/java/com/example/llamadroid/ui/components/AssetDownloadDialog.kt:33 — AssetDownloadDialogKt.AssetDownloadDialog has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 3 (7 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CuratedModelBundleSectionKt.CuratedModelBundleSection (cognitive 18) · ×1
  • CuratedModelBundleSectionKt.CuratedModelBundleSection (cognitive 18) app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:268 — CuratedModelBundleSectionKt.CuratedModelBundleSection has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4 (5 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · EasyChatModelPickerKt.EasyChatModelPicker (cognitive 18) · ×1
  • EasyChatModelPickerKt.EasyChatModelPicker (cognitive 18) app/src/main/java/com/example/llamadroid/ui/easy/EasyChatModelPicker.kt:48 — EasyChatModelPickerKt.EasyChatModelPicker has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7, error handling 4 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EasyImportKindsKt.detectEasyFileKind (cognitive 18) · ×1
  • EasyImportKindsKt.detectEasyFileKind (cognitive 18) app/src/main/java/com/example/llamadroid/ui/easy/EasyImportKinds.kt:23 — EasyImportKindsKt.detectEasyFileKind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · EasyImportKindsKt.easyImportVerdict (cognitive 18) · ×1
  • EasyImportKindsKt.easyImportVerdict (cognitive 18) app/src/main/java/com/example/llamadroid/ui/easy/EasyImportKinds.kt:49 — EasyImportKindsKt.easyImportVerdict has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2 (3 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · LiteRtModelsScreenKt.LiteRtInstalledTab (cognitive 18) · ×1
  • LiteRtModelsScreenKt.LiteRtInstalledTab (cognitive 18) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:945 — LiteRtModelsScreenKt.LiteRtInstalledTab 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.
D2 · Cognitive Complexity · ModelLibraryScreenKt.PendingArtifactCard (cognitive 18) · ×1
  • ModelLibraryScreenKt.PendingArtifactCard (cognitive 18) app/src/main/java/com/example/llamadroid/ui/models/ModelLibraryScreen.kt:1142 — ModelLibraryScreenKt.PendingArtifactCard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · ModelManagerScreenKt.importModelWithProgress (cognitive 18) · ×1
  • ModelManagerScreenKt.importModelWithProgress (cognitive 18) app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1003 — ModelManagerScreenKt.importModelWithProgress has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TitleGenerationSettingsCardKt.TitleGenerationSettingsCard (cognitive 18) · ×1
  • TitleGenerationSettingsCardKt.TitleGenerationSettingsCard (cognitive 18) app/src/main/java/com/example/llamadroid/ui/settings/TitleGenerationSettingsCard.kt:51 — TitleGenerationSettingsCardKt.TitleGenerationSettingsCard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MainActivityKt.ChatsScreen (cognitive 18) · ×1
  • MainActivityKt.ChatsScreen (cognitive 18) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1846 — MainActivityKt.ChatsScreen has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · picker.pickFolder (cognitive 18) · ×1
  • picker.pickFolder (cognitive 18) app/src/main/assets/file_station_webui/js/picker.js:8 — picker.pickFolder has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (5 pts), error handling 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 6 function items inside it that branch (show, a function literal at line 51, row, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · main.route (cognitive 18) · ×1
  • main.route (cognitive 18) app/src/main/assets/file_station_webui/js/main.js:57 — main.route has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, error handling 1 (2 pts), ternaries 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AudioWavSupport.isPcm16Silent (cognitive 17) · ×1
  • AudioWavSupport.isPcm16Silent (cognitive 17) app/src/main/java/com/example/llamadroid/audio/AudioWavSupport.kt:72 — AudioWavSupport.isPcm16Silent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AudioLibraryRepository.deleteLocalOutput (cognitive 17) · ×1
  • AudioLibraryRepository.deleteLocalOutput (cognitive 17) app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryRepository.kt:691 — AudioLibraryRepository.deleteLocalOutput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelSourceRepository.awaitDownloadCompletion (cognitive 17) · ×1
  • ModelSourceRepository.awaitDownloadCompletion (cognitive 17) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:2349 — ModelSourceRepository.awaitDownloadCompletion has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProotManager.extractDataFromDeb (cognitive 17) · ×1
  • ProotManager.extractDataFromDeb (cognitive 17) app/src/main/java/com/example/llamadroid/data/proot/ProotManager.kt:363 — ProotManager.extractDataFromDeb has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 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.
D2 · Cognitive Complexity · HarnessLegacyDeletion.finish (cognitive 17) · ×1
  • HarnessLegacyDeletion.finish (cognitive 17) app/src/main/java/com/example/llamadroid/harness/HarnessLegacyDeletion.kt:67 — HarnessLegacyDeletion.finish has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · HarnessLegacyHistoryKt.HarnessLegacyHistory (cognitive 17) · ×1
  • HarnessLegacyHistoryKt.HarnessLegacyHistory (cognitive 17) app/src/main/java/com/example/llamadroid/harness/HarnessLegacyHistory.kt:43 — HarnessLegacyHistoryKt.HarnessLegacyHistory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessLocalModelCapabilityStore.apply (cognitive 17) · ×1
  • HarnessLocalModelCapabilityStore.apply (cognitive 17) app/src/main/java/com/example/llamadroid/harness/HarnessLocalModelCapabilities.kt:133 — HarnessLocalModelCapabilityStore.apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessProviderErrorCodes.classify (cognitive 17) · ×1
  • HarnessProviderErrorCodes.classify (cognitive 17) app/src/main/java/com/example/llamadroid/harness/HarnessProviderErrorCodes.kt:38 — HarnessProviderErrorCodes.classify has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessSessionDeletion.wake (cognitive 17) · ×1
  • HarnessSessionDeletion.wake (cognitive 17) app/src/main/java/com/example/llamadroid/harness/HarnessSessionDeletion.kt:92 — HarnessSessionDeletion.wake has cognitive complexity 17 (threshold 15). Drivers by points: error handling 2 (6 pts), if/else 4 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessTerminalDialogKt.HarnessTerminalRoute (cognitive 17) · ×1
  • HarnessTerminalDialogKt.HarnessTerminalRoute (cognitive 17) app/src/main/java/com/example/llamadroid/harness/HarnessTerminalDialog.kt:177 — HarnessTerminalDialogKt.HarnessTerminalRoute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, error handling 4 (6 pts), boolean chains 3, loops 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdModelSupportKt.resolveSdFamilySpec (cognitive 17) · ×1
  • SdModelSupportKt.resolveSdFamilySpec (cognitive 17) app/src/main/java/com/example/llamadroid/sd/SdModelSupport.kt:681 — SdModelSupportKt.resolveSdFamilySpec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · SdParamsBackendProfile.parse (cognitive 17) · ×1
  • SdParamsBackendProfile.parse (cognitive 17) app/src/main/java/com/example/llamadroid/sd/SdParamsBackendProfile.kt:147 — SdParamsBackendProfile.parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentDurableContractStore.normalizeAgentReportOutcome (cognitive 17) · ×1
  • AgentDurableContractStore.normalizeAgentReportOutcome (cognitive 17) app/src/main/java/com/example/llamadroid/service/AgentDurableContractStore.kt:1963 — AgentDurableContractStore.normalizeAgentReportOutcome has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 3, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentForegroundService.onStartCommand (cognitive 17) · ×1
  • AgentForegroundService.onStartCommand (cognitive 17) app/src/main/java/com/example/llamadroid/service/AgentForegroundService.kt:461 — AgentForegroundService.onStartCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentPromptBudgetKt.buildAgentPromptAtomicUnits (cognitive 17) · ×1
  • AgentPromptBudgetKt.buildAgentPromptAtomicUnits (cognitive 17) app/src/main/java/com/example/llamadroid/service/AgentPromptBudget.kt:672 — AgentPromptBudgetKt.buildAgentPromptAtomicUnits has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.persistFrozenTurnContext (cognitive 17) · ×1
  • AgentService.persistFrozenTurnContext (cognitive 17) app/src/main/java/com/example/llamadroid/service/AgentService.kt:4371 — AgentService.persistFrozenTurnContext has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, match/switch 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentService.runHardCompactionIfNeeded (cognitive 17) · ×1
  • AgentService.runHardCompactionIfNeeded (cognitive 17) app/src/main/java/com/example/llamadroid/service/AgentService.kt:15010 — AgentService.runHardCompactionIfNeeded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ToolHttpServer.startPdfToolJob (cognitive 17) · ×1
  • ToolHttpServer.startPdfToolJob (cognitive 17) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:1775 — ToolHttpServer.startPdfToolJob has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepResearchSupport.scoreCandidate (cognitive 17) · ×1
  • DeepResearchSupport.scoreCandidate (cognitive 17) app/src/main/java/com/example/llamadroid/service/DeepResearchSupport.kt:190 — DeepResearchSupport.scoreCandidate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · GenerationQueueService.drain (cognitive 17) · ×1
  • GenerationQueueService.drain (cognitive 17) app/src/main/java/com/example/llamadroid/service/GenerationQueueService.kt:131 — GenerationQueueService.drain has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveTranslatorService.startLoop (cognitive 17) · ×1
  • LiveTranslatorService.startLoop (cognitive 17) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:186 — LiveTranslatorService.startLoop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaClientService.chatWithLiteRtToolsStreaming (cognitive 17) · ×1
  • LlamaClientService.chatWithLiteRtToolsStreaming (cognitive 17) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:2460 — LlamaClientService.chatWithLiteRtToolsStreaming has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · NativeChatLocalServerStarter.ensureReady (cognitive 17) · ×1
  • NativeChatLocalServerStarter.ensureReady (cognitive 17) app/src/main/java/com/example/llamadroid/service/NativeChatLocalServerStarter.kt:72 — NativeChatLocalServerStarter.ensureReady has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), match/switch 2 (5 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeVideoDependencies.ensure (cognitive 17) · ×1
  • NativeVideoDependencies.ensure (cognitive 17) app/src/main/java/com/example/llamadroid/service/NativeVideoDependencies.kt:25 — NativeVideoDependencies.ensure has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFService.collectPdfOcrText (cognitive 17) · ×1
  • PDFService.collectPdfOcrText (cognitive 17) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2817 — PDFService.collectPdfOcrText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuadtrixTrainingService.updateQuadtrixNotification (cognitive 17) · ×1
  • QuadtrixTrainingService.updateQuadtrixNotification (cognitive 17) app/src/main/java/com/example/llamadroid/service/QuadtrixTrainingService.kt:467 — QuadtrixTrainingService.updateQuadtrixNotification has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2 (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.
D2 · Cognitive Complexity · RemoteMasterServer.handleRestart (cognitive 17) · ×1
  • RemoteMasterServer.handleRestart (cognitive 17) app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:392 — RemoteMasterServer.handleRestart has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SdAdetailerSupportKt.validateSdADetailerConfig (cognitive 17) · ×1
  • SdAdetailerSupportKt.validateSdADetailerConfig (cognitive 17) app/src/main/java/com/example/llamadroid/service/SdAdetailerSupport.kt:72 — SdAdetailerSupportKt.validateSdADetailerConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · VideoGenerationService.startGeneration (cognitive 17) · ×1
  • VideoGenerationService.startGeneration (cognitive 17) app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:171 — VideoGenerationService.startGeneration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 3, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoRecognitionSummaryService.startLegacyFallback (cognitive 17) · ×1
  • VideoRecognitionSummaryService.startLegacyFallback (cognitive 17) app/src/main/java/com/example/llamadroid/service/VideoRecognitionSummaryService.kt:1131 — VideoRecognitionSummaryService.startLegacyFallback has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VideoUpscalerService.getVideoInfo (cognitive 17) · ×1
  • VideoUpscalerService.getVideoInfo (cognitive 17) app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:179 — VideoUpscalerService.getVideoInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TamaChatContextBudgetKt.mapTamaImages (cognitive 17) · ×1
  • TamaChatContextBudgetKt.mapTamaImages (cognitive 17) app/src/main/java/com/example/llamadroid/tama/game/TamaChatContextBudget.kt:91 — TamaChatContextBudgetKt.mapTamaImages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TamaGameEngine.advancePoopState (cognitive 17) · ×1
  • TamaGameEngine.advancePoopState (cognitive 17) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:3775 — TamaGameEngine.advancePoopState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AdventureGateScreenKt.AdventureGateLoadoutDialog (cognitive 17) · ×1
  • AdventureGateScreenKt.AdventureGateLoadoutDialog (cognitive 17) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1061 — AdventureGateScreenKt.AdventureGateLoadoutDialog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FarmActionController.batch (cognitive 17) · ×1
  • FarmActionController.batch (cognitive 17) app/src/main/java/com/example/llamadroid/tama/ui/farm/FarmActionController.kt:46 — FarmActionController.batch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomToolsScreenKt.CustomToolEditorDialog (cognitive 17) · ×1
  • CustomToolsScreenKt.CustomToolEditorDialog (cognitive 17) app/src/main/java/com/example/llamadroid/ui/agent/CustomToolsScreen.kt:215 — CustomToolsScreenKt.CustomToolEditorDialog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessComposerKt.replaceHarnessComposerToken (cognitive 17) · ×1
  • HarnessComposerKt.replaceHarnessComposerToken (cognitive 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessComposer.kt:103 — HarnessComposerKt.replaceHarnessComposerToken has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NativeHarnessController.refreshSessions (cognitive 17) · ×1
  • NativeHarnessController.refreshSessions (cognitive 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:871 — NativeHarnessController.refreshSessions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeHarnessController.applyControlFrame (cognitive 17) · ×1
  • NativeHarnessController.applyControlFrame (cognitive 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessController.kt:1926 — NativeHarnessController.applyControlFrame has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · NativeHarnessCustomProviderPanelKt.NativeHarnessCustomProviderPanel (cognitive 17) · ×1
  • NativeHarnessCustomProviderPanelKt.NativeHarnessCustomProviderPanel (cognitive 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCustomProviderPanel.kt:50 — NativeHarnessCustomProviderPanelKt.NativeHarnessCustomProviderPanel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NativeHarnessDraftProviderDiscovery.discover (cognitive 17) · ×1
  • NativeHarnessDraftProviderDiscovery.discover (cognitive 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessDraftProviderDiscovery.kt:55 — NativeHarnessDraftProviderDiscovery.discover has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NativeHarnessFeedbackActions.refresh (cognitive 17) · ×1
  • NativeHarnessFeedbackActions.refresh (cognitive 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessFeedback.kt:29 — NativeHarnessFeedbackActions.refresh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeHarnessStructuredTranscriptKt.reprojectNativeHarnessLiveSkillBatch (cognitive 17) · ×1
  • NativeHarnessStructuredTranscriptKt.reprojectNativeHarnessLiveSkillBatch (cognitive 17) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessStructuredTranscript.kt:369 — NativeHarnessStructuredTranscriptKt.reprojectNativeHarnessLiveSkillBatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, match/switch 5 (7 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ImageGenPhaseCOptionsKt.ImageGenADetailerOptionsCard (cognitive 17) · ×1
  • ImageGenPhaseCOptionsKt.ImageGenADetailerOptionsCard (cognitive 17) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenPhaseCOptions.kt:174 — ImageGenPhaseCOptionsKt.ImageGenADetailerOptionsCard has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InpaintMaskRaster.paintCircle (cognitive 17) · ×1
  • InpaintMaskRaster.paintCircle (cognitive 17) app/src/main/java/com/example/llamadroid/ui/ai/InpaintMaskRaster.kt:51 — InpaintMaskRaster.paintCircle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (3 pts), match/switch 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.
D2 · Cognitive Complexity · OnnxTtsScreenKt.OnnxTtsScreen (cognitive 17) · ×1
  • OnnxTtsScreenKt.OnnxTtsScreen (cognitive 17) app/src/main/java/com/example/llamadroid/ui/ai/OnnxTtsScreen.kt:88 — OnnxTtsScreenKt.OnnxTtsScreen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, error handling 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ChatDelegationServerBlocksKt.DelegationServerUsageLine (cognitive 17) · ×1
  • ChatDelegationServerBlocksKt.DelegationServerUsageLine (cognitive 17) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatDelegationServerBlocks.kt:270 — ChatDelegationServerBlocksKt.DelegationServerUsageLine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalServerFormKt.validateLocalForm (cognitive 17) · ×1
  • LocalServerFormKt.validateLocalForm (cognitive 17) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/LocalServerForm.kt:117 — LocalServerFormKt.validateLocalForm has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ChatScreenKt.ChatScreen (cognitive 17) · ×1
  • ChatScreenKt.ChatScreen (cognitive 17) app/src/main/java/com/example/llamadroid/ui/chat/ChatScreen.kt:74 — ChatScreenKt.ChatScreen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ContextUsageRingKt.ContextUsageRing (cognitive 17) · ×1
  • ContextUsageRingKt.ContextUsageRing (cognitive 17) app/src/main/java/com/example/llamadroid/ui/components/ContextUsageRing.kt:38 — ContextUsageRingKt.ContextUsageRing has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · EasyModelRemovalKt.removeEasyModels (cognitive 17) · ×1
  • EasyModelRemovalKt.removeEasyModels (cognitive 17) app/src/main/java/com/example/llamadroid/ui/easy/EasyModelRemoval.kt:94 — EasyModelRemovalKt.removeEasyModels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LogsScreenKt.LogsScreen (cognitive 17) · ×1
  • LogsScreenKt.LogsScreen (cognitive 17) app/src/main/java/com/example/llamadroid/ui/logs/LogsScreen.kt:53 — LogsScreenKt.LogsScreen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 4, boolean chains 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LiteRtModelsScreenKt.LiteRtCatalogTab (cognitive 17) · ×1
  • LiteRtModelsScreenKt.LiteRtCatalogTab (cognitive 17) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1257 — LiteRtModelsScreenKt.LiteRtCatalogTab has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OnnxModelsScreenKt.InstalledOnnxModelsTab (cognitive 17) · ×1
  • OnnxModelsScreenKt.InstalledOnnxModelsTab (cognitive 17) app/src/main/java/com/example/llamadroid/ui/models/OnnxModelsScreen.kt:652 — OnnxModelsScreenKt.InstalledOnnxModelsTab has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, match/switch 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TamaFarmWidgetProvider.updateWidget (cognitive 17) · ×1
  • TamaFarmWidgetProvider.updateWidget (cognitive 17) app/src/main/java/com/example/llamadroid/widget/TamaFarmWidget.kt:128 — TamaFarmWidgetProvider.updateWidget has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StableAudio3WorkerService.verifyComponents (cognitive 16) · ×1
  • StableAudio3WorkerService.verifyComponents (cognitive 16) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3WorkerService.kt:190 — StableAudio3WorkerService.verifyComponents has cognitive complexity 16 (threshold 15). Drivers by points: error handling 5 (10 pts), boolean chains 4, if/else 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelArtifactGroupsKt.resolvePendingArtifactGroup (cognitive 16) · ×1
  • ModelArtifactGroupsKt.resolvePendingArtifactGroup (cognitive 16) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactGroups.kt:43 — ModelArtifactGroupsKt.resolvePendingArtifactGroup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarnessAndroidBridge.serve (cognitive 16) · ×1
  • HarnessAndroidBridge.serve (cognitive 16) app/src/main/java/com/example/llamadroid/harness/HarnessAndroidBridge.kt:70 — HarnessAndroidBridge.serve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 2, error handling 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HarnessLegacyDeleteDialogKt.HarnessLegacyDeleteDialog (cognitive 16) · ×1
  • HarnessLegacyDeleteDialogKt.HarnessLegacyDeleteDialog (cognitive 16) app/src/main/java/com/example/llamadroid/harness/HarnessLegacyDeleteDialog.kt:15 — HarnessLegacyDeleteDialogKt.HarnessLegacyDeleteDialog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HarnessTransferMetadata.apply (cognitive 16) · ×1
  • HarnessTransferMetadata.apply (cognitive 16) app/src/main/java/com/example/llamadroid/harness/HarnessTransferMetadata.kt:409 — HarnessTransferMetadata.apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 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.
D2 · Cognitive Complexity · HarnessWorkspaceFiles.ensureDirectories (cognitive 16) · ×1
  • HarnessWorkspaceFiles.ensureDirectories (cognitive 16) app/src/main/java/com/example/llamadroid/harness/HarnessWorkspaceFiles.kt:180 — HarnessWorkspaceFiles.ensureDirectories has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessRequestReceipts.execute (cognitive 16) · ×1
  • HarnessRequestReceipts.execute (cognitive 16) app/src/main/java/com/example/llamadroid/harness/client/HarnessRequestReceipts.kt:12 — HarnessRequestReceipts.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, error handling 2, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OkHttpHarnessClient.stream (cognitive 16) · ×1
  • OkHttpHarnessClient.stream (cognitive 16) app/src/main/java/com/example/llamadroid/harness/client/OkHttpHarnessClient.kt:363 — OkHttpHarnessClient.stream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 2 (3 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.
D2 · Cognitive Complexity · HarnessMux.ensureSocket (cognitive 16) · ×1
  • HarnessMux.ensureSocket (cognitive 16) app/src/main/java/com/example/llamadroid/harness/client/OkHttpHarnessClient.kt:695 — HarnessMux.ensureSocket has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessTransferCodec.inspect (cognitive 16) · ×1
  • HarnessTransferCodec.inspect (cognitive 16) app/src/main/java/com/example/llamadroid/harness/transfer/HarnessTransferCodec.kt:97 — HarnessTransferCodec.inspect has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · OnnxTtsSupportKt.chunkText (cognitive 16) · ×1
  • OnnxTtsSupportKt.chunkText (cognitive 16) app/src/main/java/com/example/llamadroid/onnx/OnnxTtsSupport.kt:730 — OnnxTtsSupportKt.chunkText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.
D2 · Cognitive Complexity · SdPipelineResolver.requiredExternalRoles (cognitive 16) · ×1
  • SdPipelineResolver.requiredExternalRoles (cognitive 16) app/src/main/java/com/example/llamadroid/sd/SdPipelineResolver.kt:285 — SdPipelineResolver.requiredExternalRoles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentImageOperations.generateSdAgentImage (cognitive 16) · ×1
  • AgentImageOperations.generateSdAgentImage (cognitive 16) app/src/main/java/com/example/llamadroid/service/AgentImageOperations.kt:112 — AgentImageOperations.generateSdAgentImage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentLocalProjectRunner.stopProject (cognitive 16) · ×1
  • AgentLocalProjectRunner.stopProject (cognitive 16) app/src/main/java/com/example/llamadroid/service/AgentLocalProjectRunner.kt:112 — AgentLocalProjectRunner.stopProject has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.persistVisibleRuntimeStateNow (cognitive 16) · ×1
  • AgentService.persistVisibleRuntimeStateNow (cognitive 16) app/src/main/java/com/example/llamadroid/service/AgentService.kt:688 — AgentService.persistVisibleRuntimeStateNow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentService.deletePath (cognitive 16) · ×1
  • AgentService.deletePath (cognitive 16) app/src/main/java/com/example/llamadroid/service/AgentService.kt:1525 — AgentService.deletePath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.summarizeAgentReferenceContent (cognitive 16) · ×1
  • AgentService.summarizeAgentReferenceContent (cognitive 16) app/src/main/java/com/example/llamadroid/service/AgentService.kt:20373 — AgentService.summarizeAgentReferenceContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.drainAgentContinuationQueue (cognitive 16) · ×1
  • AgentService.drainAgentContinuationQueue (cognitive 16) app/src/main/java/com/example/llamadroid/service/AgentService.kt:5004 — AgentService.drainAgentContinuationQueue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentService.extractWorkspaceFileReferences (cognitive 16) · ×1
  • AgentService.extractWorkspaceFileReferences (cognitive 16) app/src/main/java/com/example/llamadroid/service/AgentService.kt:14621 — AgentService.extractWorkspaceFileReferences has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 6, 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.
D2 · Cognitive Complexity · AgentService.restoreHardCompactionStateFromBrain (cognitive 16) · ×1
  • AgentService.restoreHardCompactionStateFromBrain (cognitive 16) app/src/main/java/com/example/llamadroid/service/AgentService.kt:14789 — AgentService.restoreHardCompactionStateFromBrain has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ToolHttpServer.validateModelCapabilities (cognitive 16) · ×1
  • ToolHttpServer.validateModelCapabilities (cognitive 16) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:1484 — ToolHttpServer.validateModelCapabilities has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (6 pts), match/switch 1 (nesting depth added 3). 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.
D2 · Cognitive Complexity · CustomToolHttpExecutor.execute (cognitive 16) · ×1
  • CustomToolHttpExecutor.execute (cognitive 16) app/src/main/java/com/example/llamadroid/service/CustomToolHttpExecutor.kt:152 — CustomToolHttpExecutor.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DistributedService.startWorkerMode (cognitive 16) · ×1
  • DistributedService.startWorkerMode (cognitive 16) app/src/main/java/com/example/llamadroid/service/DistributedService.kt:1301 — DistributedService.startWorkerMode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiteRtLmChatService.backendCandidates (cognitive 16) · ×1
  • LiteRtLmChatService.backendCandidates (cognitive 16) app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:408 — LiteRtLmChatService.backendCandidates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, match/switch 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.
D2 · Cognitive Complexity · LiveTranslatorService.recordUtterance (cognitive 16) · ×1
  • LiveTranslatorService.recordUtterance (cognitive 16) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:392 — LiveTranslatorService.recordUtterance has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaCallService.recordUtterance (cognitive 16) · ×1
  • LlamaCallService.recordUtterance (cognitive 16) app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:247 — LlamaCallService.recordUtterance has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaClientService.onStartCommand (cognitive 16) · ×1
  • LlamaClientService.onStartCommand (cognitive 16) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:278 — LlamaClientService.onStartCommand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, match/switch 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.
D2 · Cognitive Complexity · LlamaClientService.selectLiteRtToolsForPrompt (cognitive 16) · ×1
  • LlamaClientService.selectLiteRtToolsForPrompt (cognitive 16) app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:2930 — LlamaClientService.selectLiteRtToolsForPrompt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, 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.
D2 · Cognitive Complexity · LlamaServerLauncher.composeLlamaOcrFlags (cognitive 16) · ×1
  • LlamaServerLauncher.composeLlamaOcrFlags (cognitive 16) app/src/main/java/com/example/llamadroid/service/LlamaServerLauncher.kt:117 — LlamaServerLauncher.composeLlamaOcrFlags has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFService.translationGroupsShouldMerge (cognitive 16) · ×1
  • PDFService.translationGroupsShouldMerge (cognitive 16) app/src/main/java/com/example/llamadroid/service/PDFService.kt:1878 — PDFService.translationGroupsShouldMerge has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), match/switch 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PDFService.collectImageOcrText (cognitive 16) · ×1
  • PDFService.collectImageOcrText (cognitive 16) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2964 — PDFService.collectImageOcrText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFService.performOCR (cognitive 16) · ×1
  • PDFService.performOCR (cognitive 16) app/src/main/java/com/example/llamadroid/service/PDFService.kt:7599 — PDFService.performOCR has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProcessController.substituteTemplateValues (cognitive 16) · ×1
  • ProcessController.substituteTemplateValues (cognitive 16) app/src/main/java/com/example/llamadroid/service/ProcessController.kt:495 — ProcessController.substituteTemplateValues has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15 (16 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · UnifiedNotificationManager.updateSummaryNotification (cognitive 16) · ×1
  • UnifiedNotificationManager.updateSummaryNotification (cognitive 16) app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:809 — UnifiedNotificationManager.updateSummaryNotification has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NativeChatStepHistory.expand (cognitive 16) · ×1
  • NativeChatStepHistory.expand (cognitive 16) app/src/main/java/com/example/llamadroid/service/chat/NativeChatStepHistory.kt:42 — NativeChatStepHistory.expand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeChatTurnDecorators.apply (cognitive 16) · ×1
  • NativeChatTurnDecorators.apply (cognitive 16) app/src/main/java/com/example/llamadroid/service/compaction/NativeChatTurnDecorators.kt:26 — NativeChatTurnDecorators.apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 2, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DelegationFileBridge.resolve (cognitive 16) · ×1
  • DelegationFileBridge.resolve (cognitive 16) app/src/main/java/com/example/llamadroid/service/delegation/DelegationFileBridge.kt:89 — DelegationFileBridge.resolve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelegationProjectFiles.list (cognitive 16) · ×1
  • DelegationProjectFiles.list (cognitive 16) app/src/main/java/com/example/llamadroid/service/delegation/DelegationProjectFiles.kt:76 — DelegationProjectFiles.list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TamaCommerceCatalog.offer (cognitive 16) · ×1
  • TamaCommerceCatalog.offer (cognitive 16) app/src/main/java/com/example/llamadroid/tama/data/TamaCommerceCatalog.kt:19 — TamaCommerceCatalog.offer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 2 (3 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · GeneticTraits.inherit (cognitive 16) · ×1
  • GeneticTraits.inherit (cognitive 16) app/src/main/java/com/example/llamadroid/tama/data/TamaPet.kt:239 — GeneticTraits.inherit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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.
D2 · Cognitive Complexity · FarmEngine.updateFarm (cognitive 16) · ×1
  • FarmEngine.updateFarm (cognitive 16) app/src/main/java/com/example/llamadroid/tama/game/FarmEngine.kt:27 — FarmEngine.updateFarm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · TamaArcadeSessionRules.validate (cognitive 16) · ×1
  • TamaArcadeSessionRules.validate (cognitive 16) app/src/main/java/com/example/llamadroid/tama/game/TamaArcadeSessionRules.kt:39 — TamaArcadeSessionRules.validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, match/switch 3 (5 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessCommandsTabKt.HarnessCommandsTab (cognitive 16) · ×1
  • HarnessCommandsTabKt.HarnessCommandsTab (cognitive 16) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessCommandsTab.kt:52 — HarnessCommandsTabKt.HarnessCommandsTab has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 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.
D2 · Cognitive Complexity · HarnessExtensionsPanelsKt.HarnessPluginRow (cognitive 16) · ×1
  • HarnessExtensionsPanelsKt.HarnessPluginRow (cognitive 16) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessExtensionsPanels.kt:480 — HarnessExtensionsPanelsKt.HarnessPluginRow has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6, match/switch 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · NativeHarnessProviderCreationKt.validateNativeCustomProviderRequest (cognitive 16) · ×1
  • NativeHarnessProviderCreationKt.validateNativeCustomProviderRequest (cognitive 16) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProviderCreation.kt:146 — NativeHarnessProviderCreationKt.validateNativeCustomProviderRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NativeHarnessProviderSaveKt.buildNativeHarnessProviderSavePlan (cognitive 16) · ×1
  • NativeHarnessProviderSaveKt.buildNativeHarnessProviderSavePlan (cognitive 16) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessProviderSave.kt:23 — NativeHarnessProviderSaveKt.buildNativeHarnessProviderSavePlan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, error handling 1, match/switch 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessAssistantStreamTracker.accept (cognitive 16) · ×1
  • HarnessAssistantStreamTracker.accept (cognitive 16) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessStreaming.kt:64 — HarnessAssistantStreamTracker.accept has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FastsdGalleryScreenKt.ImageCard (cognitive 16) · ×1
  • FastsdGalleryScreenKt.ImageCard (cognitive 16) app/src/main/java/com/example/llamadroid/ui/ai/FastsdGalleryScreen.kt:480 — FastsdGalleryScreenKt.ImageCard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SdCuratedBundlesSectionKt.SdCuratedBundlesSection (cognitive 16) · ×1
  • SdCuratedBundlesSectionKt.SdCuratedBundlesSection (cognitive 16) app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:75 — SdCuratedBundlesSectionKt.SdCuratedBundlesSection has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SdCuratedBundlesSectionKt.SdCuratedBundleCard (cognitive 16) · ×1
  • SdCuratedBundlesSectionKt.SdCuratedBundleCard (cognitive 16) app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:338 — SdCuratedBundlesSectionKt.SdCuratedBundleCard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 pts), match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SdDistributedScreensKt.ImageComponentPickerSection (cognitive 16) · ×1
  • SdDistributedScreensKt.ImageComponentPickerSection (cognitive 16) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:3731 — SdDistributedScreensKt.ImageComponentPickerSection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KiwixViewerScreenKt.KiwixViewerScreen (cognitive 16) · ×1
  • KiwixViewerScreenKt.KiwixViewerScreen (cognitive 16) app/src/main/java/com/example/llamadroid/ui/kiwix/KiwixViewerScreen.kt:48 — KiwixViewerScreenKt.KiwixViewerScreen has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, match/switch 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.
D2 · Cognitive Complexity · WhisperVadModelsSectionKt.WhisperVadModelsSection (cognitive 16) · ×1
  • WhisperVadModelsSectionKt.WhisperVadModelsSection (cognitive 16) app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:64 — WhisperVadModelsSectionKt.WhisperVadModelsSection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 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.
D2 · Cognitive Complexity · NotesManagerScreenKt.NoteFullScreenDialog (cognitive 16) · ×1
  • NotesManagerScreenKt.NoteFullScreenDialog (cognitive 16) app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2211 — NotesManagerScreenKt.NoteFullScreenDialog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhisperSettingsScreenKt.WhisperSettingsContent (cognitive 16) · ×1
  • WhisperSettingsScreenKt.WhisperSettingsContent (cognitive 16) app/src/main/java/com/example/llamadroid/ui/settings/WhisperSettingsScreen.kt:56 — WhisperSettingsScreenKt.WhisperSettingsContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, 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.
D2 · Cognitive Complexity · WearCompanionStore.applyGenerationFinal (cognitive 16) · ×1
  • WearCompanionStore.applyGenerationFinal (cognitive 16) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1395 — WearCompanionStore.applyGenerationFinal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 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.
D2 · Cognitive Complexity · MainActivityKt.locationBackgroundAssetPath (cognitive 16) · ×1
  • MainActivityKt.locationBackgroundAssetPath (cognitive 16) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:3201 — MainActivityKt.locationBackgroundAssetPath has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 14, if/else 1, match/switch 1. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · app.syncActiveChatState (cognitive 16) · ×1
  • app.syncActiveChatState (cognitive 16) app/src/main/assets/ai_servers_webui/app.js:431 — app.syncActiveChatState has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 5. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · browser.initBrowser (cognitive 16) · ×1
  • browser.initBrowser (cognitive 16) app/src/main/assets/file_station_webui/js/browser.js:227 — browser.initBrowser has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (nesting depth added 2). None of this is in the body itself: all 16 points belong to 6 function literals inside it that branch (lines 257, 254, 230, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (96 shared lines) · ×1
  • Near-duplicate member pair (96 shared lines) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:62 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:62-302 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:44-235 — These two members are variants of one another: 96 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 · Near-duplicate member pair (88 shared lines) · ×1
  • Near-duplicate member pair (88 shared lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:267 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:267-515 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:561-744 — These two members are variants of one another: 88 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 · Near-duplicate member pair (80 shared lines) · ×1
  • Near-duplicate member pair (80 shared lines) app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:346 — app/src/main/java/com/example/llamadroid/ui/ai/SdCuratedBundlesSection.kt:346-517 | app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:529-700 — These two members are variants of one another: 80 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 · Near-duplicate member pair (76 shared lines) · ×1
  • Near-duplicate member pair (76 shared lines) app/src/main/java/com/example/llamadroid/service/PDFService.kt:2824 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:2824-2962 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:2975-3120 — These two members are variants of one another: 76 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 · Near-duplicate member pair (71 shared lines) · ×1
  • Near-duplicate member pair (71 shared lines) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:516 — app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:516-634 | app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:981-1183 — These two members are variants of one another: 71 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 · Near-duplicate member pair (68 shared lines) · ×1
  • Near-duplicate member pair (68 shared lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1409 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1409-1653 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1699-1877 — These two members are variants of one another: 68 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (61 shared lines) · ×1
  • Near-duplicate member pair (61 shared lines) wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1929 — wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:1929-2074 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:2077-2194 — These two members are variants of one another: 61 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 · Near-duplicate member pair (51 shared lines) · ×1
  • Near-duplicate member pair (51 shared lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:304 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:304-406 | app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:414-521 — These two members are variants of one another: 51 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 · Near-duplicate member pair (45 shared lines) · ×1
  • Near-duplicate member pair (45 shared lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:20532 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:20532-20672 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:20676-20790 — These two members are variants of one another: 45 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (42 shared lines) · ×1
  • Near-duplicate member pair (42 shared lines) app/src/main/java/com/example/llamadroid/service/PDFService.kt:7018 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:7018-7079 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:7091-7155 — These two members are variants of one another: 42 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 · Near-duplicate member pair (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1699 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1699-1877 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:561-744 — These two members are variants of one another: 37 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 · Near-duplicate member pair (35 shared lines) · ×1
  • Near-duplicate member pair (35 shared lines) app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1169 — app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1169-1233 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1235-1305 — These two members are variants of one another: 35 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 · Near-duplicate member pair (32 shared lines) · ×1
  • Near-duplicate member pair (32 shared lines) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3796 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3796-3893 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:3900-3974 — These two members are variants of one another: 32 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (30 shared lines) · ×1
  • Near-duplicate member pair (30 shared lines) app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:820 — app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:820-860 | app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:1040-1079 — These two members are variants of one another: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatServerSheet.kt:45 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatServerSheet.kt:45-100 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chatlist/NewChatSheet.kt:82-306 | app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:67-296 | app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/ServerDetailSheet.kt:92-288 | app/src/main/java/com/example/llamadroid/ui/easy/EasyChatOptionsSheet.kt:87-281 | app/src/main/java/com/example/llamadroid/ui/quicksetup/QuickSetupSheet.kt:31-59 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (121 corresponding lines) · ×1
  • Edited copy of a member (121 corresponding lines) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1177 — app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1177-1297 | app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:1305-1425 — These two members are one piece of code written twice and then edited apart: 121 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (142 corresponding lines) · ×1
  • Edited copy of a member (142 corresponding lines) app/src/main/java/com/example/llamadroid/ui/settings/TitleGenerationSettingsCard.kt:51 — app/src/main/java/com/example/llamadroid/ui/settings/TitleGenerationSettingsCard.kt:51-192 | app/src/main/java/com/example/llamadroid/ui/settings/VisionHelperSettingsCard.kt:44-195 — These two members are one piece of code written twice and then edited apart: 142 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (145 corresponding lines) · ×1
  • Edited copy of a member (145 corresponding lines) app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:847 — app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:847-1010 | app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:1018-1162 — These two members are one piece of code written twice and then edited apart: 145 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 86+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 86+ corresponding lines) app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:427 — app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:427-521 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:527-618 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:175-260 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 86 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 (99 corresponding lines) · ×1
  • Edited copy of a member (99 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:580 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:580-682 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5595-5693 — These two members are one piece of code written twice and then edited apart: 99 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (84 corresponding lines) · ×1
  • Edited copy of a member (84 corresponding lines) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2466 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2466-2549 | app/src/main/java/com/example/llamadroid/ui/library/AllMediaGalleryScreen.kt:415-504 — These two members are one piece of code written twice and then edited apart: 84 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×1
  • Edited copy of a member (54 corresponding lines) app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:334 — app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:334-387 | app/src/main/java/com/example/llamadroid/service/RemoteMasterServer.kt:392-450 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (87 corresponding lines) · ×1
  • Edited copy of a member (87 corresponding lines) app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:239 — app/src/main/java/com/example/llamadroid/data/proot/AgentProotEnvironment.kt:239-325 | app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeEnvironment.kt:317-404 — 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 (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:396 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:396-462 | app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:247-326 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (94 corresponding lines) · ×1
  • Edited copy of a member (94 corresponding lines) app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:263 — app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:263-357 | app/src/main/java/com/example/llamadroid/util/DynamicFeatureManager.kt:365-458 — These two members are one piece of code written twice and then edited apart: 94 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (73 corresponding lines) · ×1
  • Edited copy of a member (73 corresponding lines) app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:225 — app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:225-297 | app/src/main/java/com/example/llamadroid/util/AssetPackManagerUtil.kt:302-389 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCommandHistoryController.kt:141 — app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCommandHistoryController.kt:141-203 | app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessCommandHistoryController.kt:205-261 — 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 (69 corresponding lines) · ×1
  • Edited copy of a member (69 corresponding lines) app/src/main/java/com/example/llamadroid/service/DatasetBackendSupport.kt:67 — app/src/main/java/com/example/llamadroid/service/DatasetBackendSupport.kt:67-135 | app/src/main/java/com/example/llamadroid/service/DatasetBackendSupport.kt:156-228 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5739 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5739-5801 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:5808-5877 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (64 corresponding lines) · ×1
  • Edited copy of a member (64 corresponding lines) app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:206 — app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:206-269 | app/src/main/java/com/example/llamadroid/service/AdventureForegroundService.kt:271-335 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:235 — app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:235-282 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1285-1334 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) app/src/main/java/com/example/llamadroid/audio/AudioStorage.kt:89 — app/src/main/java/com/example/llamadroid/audio/AudioStorage.kt:89-144 | app/src/main/java/com/example/llamadroid/audio/AudioWavSupport.kt:144-195 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 38+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 38+ corresponding lines) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:570 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:570-607 | app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:356-397 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:4128-4174 | app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:1079-1121 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×1
  • Edited copy of a member (51 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:20073 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:20073-20131 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:20141-20191 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1513 — app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1513-1556 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureGateScreen.kt:1567-1619 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4703 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4703-4754 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6828-6877 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3984 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:3984-4032 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4398-4450 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:2609 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:2609-2636 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:2638-2665 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 35+ corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessRemoteProjectRunner.kt:473 — app/src/main/java/com/example/llamadroid/harness/HarnessRemoteProjectRunner.kt:473-507 | app/src/main/java/com/example/llamadroid/service/AgentLocalProjectRunner.kt:440-474 | app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:261-297 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1115 — app/src/main/java/com/example/llamadroid/tama/ui/TamaChatScreen.kt:1115-1157 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageMedia.kt:62-100 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 50+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 50+ corresponding lines) app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:2619 — app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:2619-2674 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4587-4636 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:4645-4694 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 50 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies 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) app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:340 — app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:340-367 | app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:399-431 | app/src/main/java/com/example/llamadroid/tama/rpg/AdventureGateRepository.kt:436-461 — 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 copy of a member (35 corresponding lines) · ×1
  • Edited copy of a member (35 corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:18223 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:18223-18257 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:18263-18300 — 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 copies of one member (3 members, 40+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 40+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1932 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1932-1973 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1981-2020 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2029-2073 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 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 (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:287 — app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:287-321 | app/src/main/java/com/example/llamadroid/service/ZimShareService.kt:270-303 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2171 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2171-2195 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2199-2221 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2242-2260 — 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, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) app/src/main/java/com/example/llamadroid/service/AgentService.kt:494 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:494-532 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:18307-18337 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:18344-18373 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 23+ corresponding lines) wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:316 — wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:316-344 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:347-375 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:382-410 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:413-435 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) app/src/main/java/com/example/llamadroid/tama/adventure/AdventureService.kt:831 — app/src/main/java/com/example/llamadroid/tama/adventure/AdventureService.kt:831-871 | app/src/main/java/com/example/llamadroid/tama/ui/AdventureScreen.kt:699-735 — 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 copies of one member (3 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 29+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatServerChangeDialogs.kt:73 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatServerChangeDialogs.kt:73-107 | app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/LowRamStartDialog.kt:22-50 | app/src/main/java/com/example/llamadroid/ui/models/ModelClassificationOverrideUi.kt:110-141 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 18+ corresponding lines) app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1075 — app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1075-1092 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1126-1146 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1148-1165 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1167-1184 | app/src/main/java/com/example/llamadroid/service/UnifiedNotificationManager.kt:1471-1489 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 34+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 34+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5018 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:5018-5052 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxTtsScreen.kt:509-542 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1952-1986 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:1995-2029 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:800-834 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:53 — app/src/main/java/com/example/llamadroid/service/SdRuntimeSupport.kt:53-73 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:775-795 | app/src/main/java/com/example/llamadroid/service/StableDiffusionService.kt:1008-1028 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 20+ corresponding lines) app/src/main/java/com/example/llamadroid/service/NativeLlamaAudioSupport.kt:269 — app/src/main/java/com/example/llamadroid/service/NativeLlamaAudioSupport.kt:269-296 | app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1264-1283 | app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:67-90 | app/src/main/java/com/example/llamadroid/service/WhisperService.kt:61-90 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/components/SharedModelComponents.kt:150 — app/src/main/java/com/example/llamadroid/ui/components/SharedModelComponents.kt:150-173 | app/src/main/java/com/example/llamadroid/ui/logs/LogsScreen.kt:663-688 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:2055-2086 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 12+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3899 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3899-3914 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3916-3932 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2732-2743 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2745-2757 | app/src/main/java/com/example/llamadroid/ui/library/AllMediaGalleryScreen.kt:688-704 | app/src/main/java/com/example/llamadroid/ui/library/AllMediaGalleryScreen.kt:706-723 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) app/src/main/java/com/example/llamadroid/service/OnnxBackgroundRemovalService.kt:121 — app/src/main/java/com/example/llamadroid/service/OnnxBackgroundRemovalService.kt:121-137 | app/src/main/java/com/example/llamadroid/service/OnnxImageGenerationService.kt:211-228 | app/src/main/java/com/example/llamadroid/service/OnnxTtsGenerationService.kt:130-147 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 12+ corresponding lines) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3ModelDoctor.kt:393 — app/src/main/java/com/example/llamadroid/audio/music/StableAudio3ModelDoctor.kt:393-404 | app/src/main/java/com/example/llamadroid/audio/music/StableAudio3WorkerService.kt:253-266 | app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactGroups.kt:135-147 | app/src/main/java/com/example/llamadroid/data/repository/KnowledgeBaseRepository.kt:1533-1544 | app/src/main/java/com/example/llamadroid/service/MediaModelSupport.kt:189-200 | app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2749-2760 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:3486-3497 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 6+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessExtensionsPanels.kt:943 — app/src/main/java/com/example/llamadroid/ui/agent/harness/HarnessExtensionsPanels.kt:943-964 | app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceScreen.kt:1483-1488 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2685-2704 | app/src/main/java/com/example/llamadroid/ui/library/AllMediaGalleryScreen.kt:616-632 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatScreenSupport.kt:230 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatScreenSupport.kt:230-239 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatScreenSupport.kt:241-250 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatScreenSupport.kt:252-265 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatScreenSupport.kt:267-276 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 17+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:35 — app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:35-51 | app/src/main/java/com/example/llamadroid/ui/settings/LLMSettingsScreen.kt:54-70 | app/src/main/java/com/example/llamadroid/ui/settings/PDFSettingsScreen.kt:55-71 | app/src/main/java/com/example/llamadroid/ui/settings/VideoUpscalerSettingsScreen.kt:26-42 | app/src/main/java/com/example/llamadroid/ui/settings/WhisperSettingsScreen.kt:35-52 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageItem.kt:47 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageItem.kt:47-63 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageItem.kt:69-85 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageItem.kt:91-107 | app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceScreen.kt:1383-1395 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 9+ corresponding lines) app/src/main/java/com/example/llamadroid/ui/ai/AiServersHubScreen.kt:891 — app/src/main/java/com/example/llamadroid/ui/ai/AiServersHubScreen.kt:891-906 | app/src/main/java/com/example/llamadroid/ui/audio/AudioWorkspaceScreen.kt:1461-1469 | app/src/main/java/com/example/llamadroid/ui/components/SettingsComponents.kt:179-201 | app/src/main/java/com/example/llamadroid/ui/easy/EasyChatOptionsSheet.kt:284-296 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1882-1905 | app/src/main/java/com/example/llamadroid/ui/settings/LlmSettingsHelpers.kt:107-124 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 7+ corresponding lines) app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:2881 — app/src/main/java/com/example/llamadroid/service/MediaTranslationWorkflowService.kt:2881-2891 | app/src/main/java/com/example/llamadroid/tama/game/TamaAgentService.kt:1418-1428 | app/src/main/java/com/example/llamadroid/tama/shimeji/ShimejiTimerFormat.kt:42-48 | app/src/main/java/com/example/llamadroid/tama/ui/TamaScreen.kt:2438-2449 | app/src/main/java/com/example/llamadroid/ui/ai/llama/delegation/DelegationViewerSupport.kt:69-76 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 14+ corresponding lines) app/src/main/java/com/example/llamadroid/tama/game/TamaDeepDreamRunCoordinator.kt:228 — app/src/main/java/com/example/llamadroid/tama/game/TamaDeepDreamRunCoordinator.kt:228-241 | app/src/main/java/com/example/llamadroid/tama/game/TamaDeepDreamRunCoordinator.kt:267-280 | app/src/main/java/com/example/llamadroid/tama/game/TamaDeepDreamRunCoordinator.kt:287-301 | app/src/main/java/com/example/llamadroid/tama/game/TamaDeepDreamRunCoordinator.kt:308-322 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 5+ corresponding lines) app/src/main/java/com/example/llamadroid/data/backup/NativeChatNotesBackupManager.kt:945 — app/src/main/java/com/example/llamadroid/data/backup/NativeChatNotesBackupManager.kt:945-950 | app/src/main/java/com/example/llamadroid/data/db/DatabaseBackupManager.kt:293-298 | app/src/main/java/com/example/llamadroid/service/AgentLocalWorkspaceSupport.kt:209-214 | app/src/main/java/com/example/llamadroid/service/MangaTranslationSupport.kt:1440-1444 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) app/src/main/java/com/example/llamadroid/audio/music/StableAudio3Models.kt:51 — app/src/main/java/com/example/llamadroid/audio/music/StableAudio3Models.kt:51-54 | app/src/main/java/com/example/llamadroid/data/model/library/ModelClassificationPolicy.kt:19-22 | app/src/main/java/com/example/llamadroid/data/model/library/ModelFamily.kt:27-30 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 3+ corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessTransferMetadata.kt:873 — app/src/main/java/com/example/llamadroid/harness/HarnessTransferMetadata.kt:873-875 | app/src/main/java/com/example/llamadroid/service/AgentDirectRuntimeSupport.kt:934-936 | app/src/main/java/com/example/llamadroid/service/AgentDurableContractStore.kt:2041-2044 | app/src/main/java/com/example/llamadroid/service/AgentToolOutputStore.kt:85-87 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 1+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 1+ corresponding lines) app/src/main/java/com/example/llamadroid/service/filestation/api/FsWriteApi.kt:215 — app/src/main/java/com/example/llamadroid/service/filestation/api/FsWriteApi.kt:215-217 | app/src/main/java/com/example/llamadroid/service/filestation/api/ToolsApi.kt:386-386 | app/src/main/java/com/example/llamadroid/service/filestation/api/UploadApi.kt:57-59 | app/src/main/java/com/example/llamadroid/service/filestation/volume/TrashStore.kt:117-121 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 2+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 2+ corresponding lines) app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:163 — app/src/main/java/com/example/llamadroid/harness/HarnessProjectManagement.kt:163-164 | app/src/main/java/com/example/llamadroid/service/AgentProotRunCoordinator.kt:377-379 | app/src/main/java/com/example/llamadroid/service/AgentProotTerminalSessionManager.kt:710-712 | app/src/main/java/com/example/llamadroid/service/AgentWorkflowModels.kt:491-493 | app/src/main/java/com/example/llamadroid/service/KvCacheKeys.kt:83-84 | app/src/main/java/com/example/llamadroid/service/LlamaPromptCacheSupport.kt:284-286 | app/src/main/java/com/example/llamadroid/service/NativeChatBasePrefix.kt:139-140 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 3+ corresponding lines) app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:3704 — app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:3704-3706 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:4086-4092 | app/src/main/java/com/example/llamadroid/service/LlamaScheduledTaskRunner.kt:445-451 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 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 · Duplicated block (50 lines × 2) · ×1
  • Duplicated block (50 lines × 2) app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:887 — app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:887-936 | app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:939-988 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/VideoGenerationConfig.kt:887` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (48–50 lines × 2) · ×1
  • Duplicated block (48–50 lines × 2) app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:1277 — app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:1277-1326 | app/src/main/java/com/example/llamadroid/ui/settings/GeneralSettingsScreen.kt:1336-1383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (46–47 lines × 2) · ×1
  • Duplicated block (46–47 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1217 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1217-1263 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2091-2136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1217` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (40–44 lines × 2) · ×1
  • Duplicated block (40–44 lines × 2) app/src/main/java/com/example/llamadroid/harness/HarnessTerminalDialog.kt:57 — app/src/main/java/com/example/llamadroid/harness/HarnessTerminalDialog.kt:57-96 | app/src/main/java/com/example/llamadroid/harness/HarnessTerminalDialog.kt:201-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/harness/HarnessTerminalDialog.kt:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4267 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4267-4308 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4970-5011 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4267` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4309` calls `onTranslateSubtitlesChange`, `optBoolean` and `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5012` 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.
D4 · Code Duplication · Duplicated block (39–40 lines × 2) · ×1
  • Duplicated block (39–40 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:235 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:235-273 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:166-205 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt` and `app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:235` 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.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:136 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:136-173 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:86-123 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt` and `app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (34–38 lines × 2) · ×1
  • Duplicated block (34–38 lines × 2) app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:172 — app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:172-209 | app/src/main/java/com/example/llamadroid/service/ZimShareService.kt:152-185 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/service/ModelShareService.kt` and `app/src/main/java/com/example/llamadroid/service/ZimShareService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/service/ZimShareService.kt:145` calls `i` and `app/src/main/java/com/example/llamadroid/service/ModelShareService.kt:164` 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.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • Duplicated block (53 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4320 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4320-4372 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5029-5081 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4320` 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.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:309 — app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt:309-344 | app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt:242-277 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/onnx/OnnxImg2ImgPipeline.kt` and `app/src/main/java/com/example/llamadroid/onnx/OnnxTxt2ImgPipeline.kt` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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.
D4 · Code Duplication · Duplicated block (31–33 lines × 2) · ×1
  • Duplicated block (31–33 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4175 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4175-4205 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4488-4520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4488` 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.
D4 · Code Duplication · Duplicated block (31–32 lines × 3) · ×1
  • Duplicated block (31–32 lines × 3) app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt:265 — app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt:265-295 | app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt:647-678 | app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt:719-750 — 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, `app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt:679` calls `isNotEmpty`, `SdUnsupportedModesException`, `toList` and `app/src/main/java/com/example/llamadroid/service/SdCliSupport.kt:752` 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.
D4 · Code Duplication · Duplicated block (30–32 lines × 2) · ×1
  • Duplicated block (30–32 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1924 — app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1924-1953 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1806-1837 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1924` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1838` calls `isNotBlank` and `app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:1954` 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.
D4 · Code Duplication · Duplicated block (29–32 lines × 2) · ×1
  • Duplicated block (29–32 lines × 2) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:157 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:157-188 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:191-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (29–31 lines × 2) · ×1
  • Duplicated block (29–31 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4893 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4893-4921 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5188-5218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5188` 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.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:399 — app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:399-428 | app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:477-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/WhisperVadModelsSection.kt:477` 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.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) app/src/main/java/com/example/llamadroid/data/model/DownloadTaskSupport.kt:48 — app/src/main/java/com/example/llamadroid/data/model/DownloadTaskSupport.kt:48-75 | app/src/main/java/com/example/llamadroid/data/model/DownloadTaskSupport.kt:94-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (23–29 lines × 2) · ×1
  • Duplicated block (23–29 lines × 2) app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundlePicker.kt:152 — app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundlePicker.kt:152-174 | app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt:292-320 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundlePicker.kt` and `app/src/main/java/com/example/llamadroid/ui/components/CuratedModelBundleSection.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:940 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:940-965 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:1050-1076 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:1047` calls `imageLoras` and `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:937` 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.
D4 · Code Duplication · Duplicated block (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:12268 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:12268-12289 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:12382-12406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:12268` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:309 — app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:309-331 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:160-184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (51 lines × 2) · ×1
  • Duplicated block (51 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:745 — app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:745-795 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:1628-1678 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:745` 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.
D4 · Code Duplication · Duplicated block (19–24 lines × 2) · ×1
  • Duplicated block (19–24 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:898 — app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:898-916 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFSummaryScreen.kt:414-437 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/VideoSumupScreen.kt:898` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3987 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3987-4008 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5412-5435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–24 lines × 2) · ×1
  • Duplicated block (15–24 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsEnvFactory.kt:54 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsEnvFactory.kt:54-68 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/LlamaChatScreen.kt:170-193 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsEnvFactory.kt:54` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–23 lines × 4) · ×1
  • Duplicated block (22–23 lines × 4) app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:555 — app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:555-576 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:656-677 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1263-1285 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:1395-1417 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:555` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) app/src/main/java/com/example/llamadroid/service/PDFService.kt:6246 — app/src/main/java/com/example/llamadroid/service/PDFService.kt:6246-6268 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:6463-6485 | app/src/main/java/com/example/llamadroid/service/PDFService.kt:6694-6716 — 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.
D4 · Code Duplication · Duplicated block (18–22 lines × 4) · ×1
  • Duplicated block (18–22 lines × 4) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3583 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3583-3604 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:121-138 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:335-352 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:351-368 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3583` 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.
D4 · Code Duplication · Duplicated block (17–22 lines × 3) · ×1
  • Duplicated block (17–22 lines × 3) app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:583 — app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:583-599 | app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt:371-387 | app/src/main/java/com/example/llamadroid/service/LlamaClientService.kt:4143-4164 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt` and `app/src/main/java/com/example/llamadroid/service/LlamaCallService.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/LiveTranslatorService.kt:583` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18–22 lines × 2) · ×1
  • Duplicated block (18–22 lines × 2) app/src/main/java/com/example/llamadroid/audio/AudioStorage.kt:101 — app/src/main/java/com/example/llamadroid/audio/AudioStorage.kt:101-118 | app/src/main/java/com/example/llamadroid/audio/AudioWavSupport.kt:156-177 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/audio/AudioStorage.kt:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:584 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:584-604 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:578-599 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:584` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3772 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3772-3789 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1988-2008 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3772` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6185 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6185-6204 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7029-7049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6185` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–20 lines × 3) · ×1
  • Duplicated block (19–20 lines × 3) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4290 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4290-4309 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4549-4568 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:816-834 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4290` 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) app/src/main/java/com/example/llamadroid/service/GenerationQueueRepository.kt:70 — app/src/main/java/com/example/llamadroid/service/GenerationQueueRepository.kt:70-88 | app/src/main/java/com/example/llamadroid/service/GenerationQueueRepository.kt:188-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/GenerationQueueRepository.kt:70` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (18–19 lines × 6) · ×1
  • Duplicated block (18–19 lines × 6) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1595 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1595-1613 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1659-1677 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1690-1707 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1787-1804 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1875-1893 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1906-1923 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1595` 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.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactFinalizer.kt:299 — app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactFinalizer.kt:299-317 | app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactFinalizer.kt:373-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/model/library/ModelArtifactFinalizer.kt:299` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×1
  • Duplicated block (15–19 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/LiveTranslatorScreen.kt:893 — app/src/main/java/com/example/llamadroid/ui/ai/LiveTranslatorScreen.kt:893-907 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatSettingsSections.kt:810-828 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/LiveTranslatorScreen.kt:893` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (18 lines × 8) · ×1
  • Duplicated block (18 lines × 8) app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:455 — app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:455-472 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:540-557 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:860-877 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:910-927 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:961-978 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1019-1036 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1074-1091 | app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1148-1165 — 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 `app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:455` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:1147` calls `log` and `app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:859` 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 4) · ×1
  • Duplicated block (17–18 lines × 4) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4349 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4349-4365 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5058-5074 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6315-6332 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7150-7167 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4349` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:325 — wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:325-342 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:356-373 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:391-408 — 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 `wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:325` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–18 lines × 2) · ×1
  • Duplicated block (13–18 lines × 2) app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:707 — app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:707-724 | app/src/main/java/com/example/llamadroid/tama/ui/ArcadeScreen.kt:1361-1373 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/ui/ArcadeMemoryGame.kt:707` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–18 lines × 2) · ×1
  • Duplicated block (12–18 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2226 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2226-2237 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3579-3596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2226` 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.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:78 — app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:78-94 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:265-281 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:301-317 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:78` 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.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:1346 — app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:1346-1360 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatMessageMedia.kt:84-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentControls.kt:1346` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–17 lines × 2) · ×1
  • Duplicated block (11–17 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3631 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3631-3647 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4336-4346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3631` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:1845 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:1845-1861 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2554-2569 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:1845` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 8) · ×1
  • Duplicated block (15–16 lines × 8) app/src/main/java/com/example/llamadroid/service/AgentService.kt:11466 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:11466-11480 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11507-11522 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11580-11594 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11752-11766 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11798-11812 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11832-11846 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:12816-12830 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:12846-12860 — 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 `app/src/main/java/com/example/llamadroid/service/AgentService.kt:11466` 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.
D4 · Code Duplication · Duplicated block (16 lines × 7) · ×1
  • Duplicated block (16 lines × 7) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:2239 — app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:2239-2254 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4187-4202 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4450-4465 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4500-4515 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4904-4919 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5147-5162 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5199-5214 — there are 7 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:2239` 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.
D4 · Code Duplication · Duplicated block (6–16 lines × 4) · ×1
  • Duplicated block (6–16 lines × 4) app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:893 — app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:893-908 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:269-274 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:431-440 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2821-2826 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:893` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:274` calls `startActivity`, `createChooser`, `getString` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:908` 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:496 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:496-511 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2078-2093 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:383-397 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:496` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:815 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:815-830 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:952-965 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:1062-1076 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:952` 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.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:423 — app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:423-436 | app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:576-591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:594` calls `updateProgress` and `app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:441` 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.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1265 — app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1265-1277 | app/src/main/java/com/example/llamadroid/service/VideoUpscalerService.kt:68-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:1265` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (9–16 lines × 2) · ×1
  • Duplicated block (9–16 lines × 2) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4089 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4089-4097 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4371-4386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4089` 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1204 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1204-1219 | app/src/main/java/com/example/llamadroid/ui/models/ModelClassificationOverrideUi.kt:201-215 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1204` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 4) · ×1
  • Duplicated block (14–15 lines × 4) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1437 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1437-1450 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1726-1739 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:294-308 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:587-601 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1437` 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.
D4 · Code Duplication · Duplicated block (10–15 lines × 2) · ×1
  • Duplicated block (10–15 lines × 2) app/src/main/java/com/example/llamadroid/service/AgentService.kt:18857 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:18857-18871 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:18922-18931 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:18857` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×1
  • Duplicated block (11–15 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:311 — app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:311-325 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:706-716 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:311` 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.
D4 · Code Duplication · Duplicated block (10–14 lines × 15) · ×1
  • Duplicated block (10–14 lines × 15) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1590 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1590-1603 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1621-1634 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1654-1667 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1685-1698 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1715-1728 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1748-1761 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1782-1795 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1812-1825 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1841-1850 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1870-1883 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1901-1914 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1931-1944 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1964-1977 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1999-2012 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2031-2044 — all 15 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1590` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1729` calls `sdFamilyEnum`, `orEmpty`, `initialCompatProfilesForModel` and `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1604` 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.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • Duplicated block (14 lines × 5) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1417 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1417-1430 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1706-1719 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:69-82 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:275-288 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:568-581 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1417` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–14 lines × 4) · ×1
  • Duplicated block (7–14 lines × 4) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2289 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2289-2295 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2425-2431 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4087-4093 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:4369-4382 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2289` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1301 — app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1301-1313 | app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1368-1381 | app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1443-1455 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:1301` 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) app/src/main/java/com/example/llamadroid/service/AgentService.kt:11462 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:11462-11473 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11502-11515 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11547-11558 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:11462` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–14 lines × 3) · ×1
  • Duplicated block (11–14 lines × 3) app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:724 — app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:724-734 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:2986-2999 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3996-4009 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:724` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–14 lines × 2) · ×1
  • Duplicated block (7–14 lines × 2) app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:396 — app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:396-402 | app/src/main/java/com/example/llamadroid/ui/library/AllMediaGalleryScreen.kt:262-275 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:396` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (3–14 lines × 3) · ×1
  • Duplicated block (3–14 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/AiServersHubScreen.kt:978 — app/src/main/java/com/example/llamadroid/ui/ai/AiServersHubScreen.kt:978-980 | app/src/main/java/com/example/llamadroid/ui/distributed/WorkerModeScreen.kt:1086-1099 | app/src/main/java/com/example/llamadroid/ui/models/ModelShareScreen.kt:480-493 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/AiServersHubScreen.kt:978` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatServerSheet.kt:46 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatServerSheet.kt:46-58 | app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:115-127 | app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/ServerDetailSheet.kt:112-124 | app/src/main/java/com/example/llamadroid/ui/easy/EasyChatOptionsSheet.kt:121-133 | app/src/main/java/com/example/llamadroid/ui/quicksetup/QuickSetupSheet.kt:32-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatServerSheet.kt:46` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1550 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1550-1562 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:141-153 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:412-424 | app/src/main/java/com/example/llamadroid/ui/settings/ImageGenSettingsScreen.kt:428-440 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1550` 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:651 — app/src/main/java/com/example/llamadroid/service/VideoGenerationService.kt:651-661 | app/src/main/java/com/example/llamadroid/service/VideoReusePayload.kt:554-566 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5957 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5957-5966 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5986-5998 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5957` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4354 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4354-4365 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5063-5074 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6288-6299 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6321-6332 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7120-7131 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7156-7167 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:4354` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) app/src/main/java/com/example/llamadroid/data/model/LocalModelImports.kt:154 — app/src/main/java/com/example/llamadroid/data/model/LocalModelImports.kt:154-165 | app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:1939-1950 | app/src/main/java/com/example/llamadroid/ui/models/ModelManagerScreen.kt:1115-1126 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:827-838 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. 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.
D4 · Code Duplication · Duplicated block (10–12 lines × 4) · ×1
  • Duplicated block (10–12 lines × 4) app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:65 — app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:65-76 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:271-282 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:564-575 | app/src/main/java/com/example/llamadroid/ui/settings/SpeculativeRunHistoryCard.kt:133-142 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:65` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (7–12 lines × 4) · ×1
  • Duplicated block (7–12 lines × 4) app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1132 — app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1132-1138 | app/src/main/java/com/example/llamadroid/ui/pdf/PDFToolboxScreen.kt:2289-2300 | app/src/main/java/com/example/llamadroid/ui/settings/ChatKvCacheStorageCard.kt:49-57 | app/src/main/java/com/example/llamadroid/ui/settings/SpeculativeRunHistoryCard.kt:53-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1554 — app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1554-1564 | app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1572-1583 | app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1595-1606 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/model/library/ModelSourceRepository.kt:1554` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:634 — app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:634-643 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5311-5322 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7238-7249 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/AudioTranscriptionScreen.kt:634` 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.
D4 · Code Duplication · Duplicated block (8–12 lines × 2) · ×1
  • Duplicated block (8–12 lines × 2) app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:773 — app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:773-780 | app/src/main/java/com/example/llamadroid/ui/settings/SpeculativeRunHistoryCard.kt:137-148 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:773` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–11 lines × 4) · ×1
  • Duplicated block (9–11 lines × 4) app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:101 — app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:101-109 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3863-3873 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2123-2133 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:975-985 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3917 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3917-3927 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:2746-2754 | app/src/main/java/com/example/llamadroid/ui/library/AllMediaGalleryScreen.kt:708-718 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:3917` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `item` to `WorkflowOutputGalleryFile` in one and `SdGeneratedMediaItem` 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:144 — app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:144-153 | app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:216-225 | app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:246-256 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/servers/PrepareCachesSheet.kt:246` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×1
  • Duplicated block (10 lines × 5) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2225 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2225-2236 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:1690-1700 | app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:1060-1069 | app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:1622-1632 | app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkHistoryScreen.kt:254-265 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2225` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) app/src/main/java/com/example/llamadroid/service/MediaModelSupport.kt:192 — app/src/main/java/com/example/llamadroid/service/MediaModelSupport.kt:192-200 | app/src/main/java/com/example/llamadroid/wear/PhoneWearGateway.kt:2751-2760 | wear/src/main/java/com/example/llamadroid/wear/MainActivity.kt:3488-3497 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/MediaModelSupport.kt:192` 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.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4169 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4169-4178 | app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt:377-384 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/LegacyUpscaleScreen.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4169` 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.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2223 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2223-2235 | app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:1060-1068 | app/src/main/java/com/example/llamadroid/ui/dataset/DatasetProjectScreen.kt:1622-1631 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:471-481 | app/src/main/java/com/example/llamadroid/ui/models/LiteRtModelsScreen.kt:524-534 | app/src/main/java/com/example/llamadroid/ui/settings/BenchmarkHistoryScreen.kt:252-264 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2223` 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 5) · ×1
  • Duplicated block (8–9 lines × 5) app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:472 — app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:472-480 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:483-491 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:494-502 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:505-513 | app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:515-522 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/models/WhisperModelsScreen.kt:472` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–9 lines × 2) · ×1
  • Duplicated block (6–9 lines × 2) wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:292 — wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:292-297 | wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:386-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `wear/src/main/java/com/example/llamadroid/wear/AdtTileServices.kt:292` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1439 — app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1439-1450 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1728-1739 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:89-96 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:297-308 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:590-601 — before extracting anything, compare `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt` and `app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:1439` 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.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×1
  • Duplicated block (6–8 lines × 2) app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:452 — app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:452-457 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:996-1003 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:452` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 8) · ×1
  • Duplicated block (7 lines × 8) app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:864 — app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:864-870 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1060-1066 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1196-1202 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1225-1231 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1298-1304 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1347-1353 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1404-1410 | app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1448-1454 — 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 `app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:864` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1297` calls `remember`, `mutableStateOf` and `app/src/main/java/com/example/llamadroid/ui/knowledge/KnowledgeBaseScreen.kt:1447` 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.
D4 · Code Duplication · Duplicated block (7 lines × 7) · ×1
  • Duplicated block (7 lines × 7) app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:101 — app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:101-107 | app/src/main/java/com/example/llamadroid/ui/agent/AgentDialogs.kt:3864-3870 | app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:4673-4679 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6783-6789 | app/src/main/java/com/example/llamadroid/ui/ai/llama/LlamaSchedulerScreen.kt:2124-2130 | app/src/main/java/com/example/llamadroid/ui/ai/llama/chat/ChatImageToolSettings.kt:976-982 | app/src/main/java/com/example/llamadroid/ui/distributed/SdDistributedScreens.kt:4653-4659 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times.
D4 · Code Duplication · Duplicated block (5–7 lines × 5) · ×1
  • Duplicated block (5–7 lines × 5) app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5298 — app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5298-5302 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5570-5576 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6409-6415 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:6658-6664 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:7221-7225 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5298` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (4–7 lines × 4) · ×1
  • Duplicated block (4–7 lines × 4) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1534 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1534-1537 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1690-1693 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1908-1914 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1961-1967 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:1908` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (4–7 lines × 3) · ×1
  • Duplicated block (4–7 lines × 3) app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:1480 — app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:1480-1486 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:1266-1269 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:1353-1359 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/TermuxScreen.kt:1480` 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.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) app/src/main/java/com/example/llamadroid/ui/dashboard/DashboardKiwixCard.kt:67 — app/src/main/java/com/example/llamadroid/ui/dashboard/DashboardKiwixCard.kt:67-73 | app/src/main/java/com/example/llamadroid/ui/kiwix/KiwixViewerScreen.kt:55-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/dashboard/DashboardKiwixCard.kt:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/dashboard/DashboardKiwixCard.kt:64` calls `rememberCoroutineScope`, `zimDao`, `getAllZims` and `app/src/main/java/com/example/llamadroid/ui/kiwix/KiwixViewerScreen.kt:52` 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:144 — app/src/main/java/com/example/llamadroid/tama/ui/TamaGalleryScreen.kt:144-153 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxBackgroundRemovalScreen.kt:268-273 | app/src/main/java/com/example/llamadroid/ui/ai/OnnxImageGenScreen.kt:430-439 | app/src/main/java/com/example/llamadroid/ui/notes/NotesManagerScreen.kt:2820-2825 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (5–6 lines × 3) · ×1
  • Duplicated block (5–6 lines × 3) app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2227 — app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2227-2232 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2244-2248 | app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2266-2270 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/tama/game/TamaGameEngine.kt:2227` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (2–5 lines × 4) · ×1
  • Duplicated block (2–5 lines × 4) app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:217 — app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:217-221 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:224-228 | app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:268-272 | app/src/main/java/com/example/llamadroid/ui/ai/WorkflowsScreen.kt:5918-5919 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:217` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/ImageGenScreen.kt:222` calls `remember`, `isCompatibleSdADetailerDetector`, `File` and `app/src/main/java/com/example/llamadroid/ui/ai/VideoGenScreen.kt:273` 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.
D4 · Code Duplication · Duplicated block (12 lines × 9) · ×1
  • Duplicated block (12 lines × 9) app/src/main/java/com/example/llamadroid/service/AgentService.kt:11472 — app/src/main/java/com/example/llamadroid/service/AgentService.kt:11472-11483 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11513-11525 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11586-11597 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11758-11769 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11804-11815 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:11838-11849 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:12822-12833 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:12852-12863 | app/src/main/java/com/example/llamadroid/service/AgentService.kt:13424-13436 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/AgentService.kt:11472` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:828 — app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:828-838 | app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:876-887 | app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:929-938 | app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:964-973 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:828` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:679 — app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:679-687 | app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:828-836 | app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:873-880 | app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:1047-1055 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:679` 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 5) · ×1
  • Duplicated block (11–12 lines × 5) app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:83 — app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:83-94 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:125-135 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:178-189 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:270-281 | app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:306-317 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/util/NativeProcessCleanup.kt:83` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (5 lines × 14) · ×1
  • Duplicated block (5 lines × 14) app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1584 — app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1584-1588 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1615-1619 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1648-1652 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1679-1683 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1709-1713 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1742-1746 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1776-1780 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1806-1810 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1864-1868 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1895-1899 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1925-1929 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1958-1962 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1993-1997 | app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:2025-2029 — all 14 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1584` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1612` calls `Spacer`, `height` and `app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:1581` 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.
DM10 · One transaction, one aggregate · One operation mutates 3 aggregates · ×1
  • One operation mutates 3 aggregates: LlamaServerSessionRuntime.remove app/src/main/java/com/example/llamadroid/service/LlamaServerSessionRuntime.kt:368 — `LlamaServerSessionRuntime.remove` saves `LlamaServerSessionOwnerStore`, `LlamaServerSessionLogStore`, `LlamaServerSessionStateStore` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×1
  • Recursive walk over a caller-supplied document has no depth cap app/src/main/java/com/example/llamadroid/ui/agent/harness/NativeHarnessFormatting.kt:118 — `harnessTextFrom` is public and takes `value: JsonElement` from its caller, and it calls itself at line 118 with a piece of `value` (and at line 125) — the function is not `tailrec`, so every call is a real frame — and nowhere in `harnessTextFrom` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `harnessTextFrom` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
X2 · Cancellation propagation · Async function without AbortSignal · ×1
  • Async function without AbortSignal: load app/src/main/assets/file_station_webui/js/i18n.js:16 — `load` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Minor — 86 finding(s)
X7 · Silent fallback defaults · Silent fallback default in catch · ×40
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/LlamaApplication.kt:290 — `removedLlmTrainingWorkIdsFromWorkDb` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/data/AppVisualStyleSettings.kt:66 — `ensureResolved` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:337 — `decodeLlamaLoraSpecs` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/data/binary/BinaryRepository.kt:587 — `nativeBuildRevisionKey` swallows every exception into `"unknown"` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:204 — `getGgufFiles` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/data/repository/LlamaServerCardRepository.kt:158 — `loadCards` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/diagnostics/ProcessExitRecorder.kt:80 — `load` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/harness/HarnessAppToolsSettings.kt:231 — `HarnessKvCacheCard` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/harness/HarnessLocalModelCapabilities.kt:129 — `read` swallows every exception into `emptyMap()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/harness/HarnessLocalModels.kt:255 — `models` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/harness/runtime/HarnessRuntimeProcess.kt:946 — `readLedger` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/AgentControlPromptSupport.kt:223 — `compactReportEvidenceJson` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/AgentDirectPlanProjection.kt:337 — `readAcceptanceCriteria` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/AgentDurableContractStore.kt:2131 — `answerItems` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:3698 — `dependencies` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/AgentProjectControlPlane.kt:3703 — `acceptanceCriteria` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:1556 — `parseAllowedToolNames` swallows every exception into `emptySet()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/AgentRuntimeSupport.kt:1580 — `parseCustomToolParameterSpecs` swallows every exception into `emptyMap()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/AgentService.kt:19530 — `readBrainFileRaw` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/AgentService.kt:4590 — `prepareSkillMetadataForTurn` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/AiToolServerService.kt:4748 — `ttsVoicesJson` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/DatasetForegroundService.kt:185 — `deserializeRuntimeJobs` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/GenerationDiagnosticsStore.kt:663 — `loadActiveSessionsLocked` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/LiteRtGpuDiagnostics.kt:554 — `fileOrDirectorySize` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/example/llamadroid/service/LiteRtLmChatService.kt:2285 — `extractLiteRtMessageContentText` 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.
  • + 15 more in this group — see findings.md.
AX6 · Interface segregation · Fat interface · ×22
  • Fat interface: AudioDao (23 abstract methods) app/src/main/java/com/example/llamadroid/audio/AudioEntities.kt:203 — `AudioDao` declares 23 abstract methods: `observeVoiceProfiles`, `getVoiceProfiles`, `getVoiceProfile`, `insertVoiceProfile`, `updateVoiceProfile`, `deleteVoiceProfile`, `observeJobs`, `observeUiJobs`, `observeJob`, `observeHistory`, `getJob`, `getClaimedJobs`, `getNextQueuedJob`, `claimQueuedJob`, `insertJob`, `updateJob`, `deleteJob`, `markRecoverableJobsInterrupted`, `requeueJob`, `markCancelling`, `cancelQueuedJob`, `getActiveJob`, `getJobsForVoice`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: AudioLibraryDao (27 abstract methods) app/src/main/java/com/example/llamadroid/audio/library/AudioLibraryEntities.kt:73 — `AudioLibraryDao` declares 27 abstract methods: `observeItemsPage`, `observeItemCount`, `matchingItemIds`, `getItem`, `getItems`, `getItemsInFolders`, `observeAllItems`, `getItemsByOriginKeys`, `insertItems`, `insertItem`, `updateItem`, `moveItems`, `renameItem`, `deleteItem`, `observeFolders`, `getFolders`, `getFolder`, `observeChildFolders`, `findFolderByName`, `insertFolder`, `updateFolder`, `deleteFolder`, `countChildFolders`, `countItemsInFolder`, `getPreferences`, `observePreferences`, `upsertPreferences`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: LlamaChatDao (23 abstract methods) app/src/main/java/com/example/llamadroid/data/dao/LlamaDaos.kt:117 — `LlamaChatDao` declares 23 abstract methods: `getAllChats`, `getEasyChats`, `getPinnedAiHubChats`, `getChatById`, `observeChatById`, `getExpiredEphemeralChats`, `insertChat`, `deleteChat`, `bindChatServer`, `bindChatServerIfUnbound`, `clearChatServerBinding`, `setPersistKvCache`, `getChatsBoundToServer`, `observeBoundChatCounts`, `updateTitle`, `updateContextSize`, `updateLastModified`, `updateSystemPrompt`, `updateApiParams`, `updateFolder`, `clearFolder`, `updateAiHubPin`, `deleteEphemeralChatById`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: LlamaScheduledTaskDao (23 abstract methods) app/src/main/java/com/example/llamadroid/data/dao/LlamaDaos.kt:321 — `LlamaScheduledTaskDao` declares 23 abstract methods: `getAllTasks`, `getTaskById`, `getDueTasks`, `getEnabledFutureTasks`, `insertTask`, `updateTask`, `deleteTaskById`, `setTaskEnabled`, `updateTaskRunState`, `getRecentLogs`, `getLogsForTask`, `getLogById`, `deleteLogById`, `deleteLogsByIds`, `deleteAllLogs`, `findLogByTaskScheduleAndStatus`, `getLogsByStatus`, `insertLog`, `updateLog`, `markLogRunning`, `markLogSuccess`, `markLogFailure`, `markLogSkipped`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: LlamaServerCardDao (16 abstract methods) app/src/main/java/com/example/llamadroid/data/dao/LlamaServerCardDao.kt:19 — `LlamaServerCardDao` declares 16 abstract methods: `observeCards`, `getCard`, `countOtherCardsUsingPreset`, `getEasyCard`, `getWearStartCard`, `observeWearStartCard`, `clearWearStartFlags`, `markWearStartCard`, `insertCard`, `updateCardRow`, `deleteCard`, `deleteCardById`, `updateName`, `updateSavedCommand`, `updatePortRow`, `updateLinkedPort`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: NativeChatDelegateTaskDao (25 abstract methods) app/src/main/java/com/example/llamadroid/data/dao/NativeChatDelegationDaos.kt:18 — `NativeChatDelegateTaskDao` declares 25 abstract methods: `getIdsForChat`, `getById`, `observeById`, `getLatestForChat`, `observeLatestForChat`, `observeForChat`, `getInStates`, `getForChatInStates`, `getWithScheduledChecks`, `getWithPendingWakes`, `getByHarnessSession`, `getLatestWithWorkspace`, `insert`, `update`, `setState`, `setStateWithError`, `updateCounters`, `setOptions`, `setProgressNote`, `setDigest`, `setScheduledCheck`, `setPendingWake`, `claimPendingWake`, `countInStates`, `countForChatInStates`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: NativeChatDelegateMessageDao (16 abstract methods) app/src/main/java/com/example/llamadroid/data/dao/NativeChatDelegationDaos.kt:136 — `NativeChatDelegateMessageDao` declares 16 abstract methods: `getForTask`, `observeForTask`, `getActiveForTask`, `observeForTaskWithRoles`, `maxSeq`, `insert`, `getUndeliveredMainToSub`, `getUndeliveredSubToMain`, `getStatusSubMessage`, `taskIdsWithUndeliveredSubToMain`, `markDelivered`, `markSubToMainDelivered`, `seqOf`, `latestMainToSubContent`, `markCompactedThrough`, `retireOlderSummaries`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: AgentChatDao (65 abstract methods) app/src/main/java/com/example/llamadroid/data/db/AgentChatDao.kt:15 — `AgentChatDao` declares 65 abstract methods: `getAllConversations`, `getProjectFolders`, `getConversation`, `observeConversation`, `insertConversationDirect`, `updateConversationDirect`, `deleteConversation`, `deleteConversationById`, `updateConversationTitle`, `updateConversationProjectMetadata`, `moveConversationToFolder`, `updateConversationSortOrder`, `updatePlanningMode`, `updateExecutionProfileDirect`, `normalizeAllExecutionProfiles`, `getConversationsNeedingDirectReanchor`, `updateResumeState`, `updateResumeStateIfIdle`, `touchConversation`, `updatePreviewUrlOverride`, `updateConversationState`, `updateKnowledgeBaseIds`, `updateRuntimeSettings`, `insertProjectFolder`, `updateProjectFolder`, `deleteProjectFolderById`, `getProjectFolder`, `renameProjectFolder`, `moveProjectFolder`, `updateProjectFolderSortOrder`, `updateProjectFolderCollapsed`, `getMessagesForConversation`, `getMessagesForConversationSync`, `getRecentMessagesForConversation`, `getRecentMessagesForConversationSync`, `getOlderMessagesForConversation`, `getNewerMessagesForConversation`, `getMessageByOriginalId`, `getToolMessage`, `cancelPendingToolApprovals`, and 25 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: AgentWorkflowDao (146 abstract methods) app/src/main/java/com/example/llamadroid/data/db/AgentWorkflowDao.kt:12 — `AgentWorkflowDao` declares 146 abstract methods: `getConversationForDirectReanchor`, `archiveStaleSpecialistInvocations`, `closeStaleTurnContexts`, `cancelStalePendingInputs`, `cancelStaleContinuations`, `cancelStalePendingQuestions`, `cancelStalePendingPlans`, `cancelStaleMessageApprovals`, `cancelStaleSleepWakes`, `releaseStaleTodoAssignments`, `updateProjectStateForDirectReanchor`, `completeDirectReanchor`, `upsertSleepWake`, `getSleepWake`, `getSleepWakeForConversation`, `getPendingSleepWakes`, `claimSleepWake`, `completeSleepWake`, `cancelSleepWakeForConversation`, `upsertMessagePart`, `upsertMessageParts`, `observeMessageParts`, `observeMessagePartsForInvocation`, `getMessageParts`, `deleteMessageParts`, `deleteMessagePartsAtOrAfter`, `deleteMessagePartsForConversation`, `upsertTurnContext`, `getTurnContext`, `getLatestTurnContext`, `getLatestOpenTurnContext`, `finishTurnContext`, `upsertSkill`, `observeSkills`, `getEnabledSkills`, `getSkill`, `deleteSkill`, `upsertSkillAssignment`, `resolveSkillAssignment`, `observeSkillAssignments`, and 106 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: AiServerDao (55 abstract methods) app/src/main/java/com/example/llamadroid/data/db/AiServerEntities.kt:246 — `AiServerDao` declares 55 abstract methods: `observeConfigs`, `getConfigs`, `getConfig`, `upsertConfig`, `upsertConfigs`, `setServerEnabled`, `observeUsers`, `getUsers`, `getUserByUsername`, `getUserById`, `upsertUser`, `deleteUser`, `observePermissions`, `getPermissionsForUser`, `getPermission`, `upsertPermission`, `upsertPermissions`, `upsertSession`, `getSession`, `deleteSession`, `deleteExpiredSessions`, `upsertArtifact`, `observeArtifactsForServer`, `observeArtifactsByType`, `observeServerArtifactPathsByType`, `getArtifactsForServer`, `getArtifactById`, `deleteArtifactByPath`, `deleteArtifactById`, `getWebProviders`, `getWebProvidersForOwner`, `getWebProvider`, `getWebProviderForOwner`, `upsertWebProvider`, `deleteWebProvider`, `getWebChats`, `getWebChatsForOwner`, `getWebChat`, `getWebChatForOwner`, `upsertWebChat`, and 15 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: AppDatabase (55 abstract methods) app/src/main/java/com/example/llamadroid/data/db/AppDatabase.kt:195 — `AppDatabase` declares 55 abstract methods: `modelLibraryDao`, `modelDao`, `chatDao`, `systemPromptDao`, `noteDao`, `zimDao`, `savedWorkerDao`, `savedCommandDao`, `llamaServerCardDao`, `workflowTemplateDao`, `benchmarkDao`, `datasetDao`, `agentChatDao`, `agentProotEnvironmentDao`, `agentProotRunDao`, `harnessDao`, `harnessTransferDao`, `harnessInstallationDao`, `agentWorkflowDao`, `customToolDao`, `customAgentDao`, `agentRuntimeProfileDao`, `agentRuntimeEndpointConfigDao`, `ollamaServerDao`, `aiRuntimeJobDao`, `llamaServerDao`, `llamaChatFolderDao`, `llamaChatPromptProfileDao`, `llamaChatDao`, `llamaMessageDao`, `nativeChatDelegateTaskDao`, `nativeChatDelegateMessageDao`, `nativeChatDelegateEventDao`, `llamaMessageAttachmentDao`, `nativeChatCompactionDao`, `llamaMessageImageDescriptionDao`, `llamaScheduledTaskDao`, `llamaSpeculativeRunDao`, `organizerDao`, `quadtrixProfileDao`, and 15 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: DatasetDao (49 abstract methods) app/src/main/java/com/example/llamadroid/data/db/DatasetDao.kt:10 — `DatasetDao` declares 49 abstract methods: `getAllProjects`, `getProjectFlow`, `getProject`, `insertProject`, `updateProject`, `deleteProject`, `getSourcesForProject`, `getSourcesForProjectSync`, `getSource`, `getSourceByProjectAndUri`, `insertSource`, `updateSource`, `deleteSource`, `getSourceCount`, `getChunksForProject`, `getChunksForProjectSync`, `getChunksForSource`, `getChunk`, `getChunksByStatus`, `insertChunk`, `insertChunks`, `updateChunk`, `deleteChunk`, `deleteChunksByIds`, `deleteChunksForSource`, `getChunkCount`, `getChunkCountForSource`, `getQAForProject`, `getQAForProjectSync`, `getQAForChunk`, `getQA`, `getQAByMinScore`, `getUnratedQA`, `getQAByStatus`, `insertQA`, `insertQAs`, `updateQA`, `deleteQA`, `deleteQAForChunk`, `getQACount`, and 9 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: GenerationQueueDao (19 abstract methods) app/src/main/java/com/example/llamadroid/data/db/GenerationQueueEntities.kt:84 — `GenerationQueueDao` declares 19 abstract methods: `observeQueue`, `historyPagingSource`, `observePendingCount`, `pendingCount`, `observeRunSummary`, `runSummary`, `observeControl`, `getControl`, `getItem`, `nextPending`, `pendingOrder`, `updatePendingOrder`, `assignRunToPending`, `runningItems`, `maxSortOrder`, `putItem`, `updateItem`, `deletePending`, `putControl`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: HarnessDao (20 abstract methods) app/src/main/java/com/example/llamadroid/data/db/HarnessDao.kt:17 — `HarnessDao` declares 20 abstract methods: `runtime`, `observeRuntime`, `observeRuntimes`, `activeRuntimes`, `deleteRuntime`, `saveRuntime`, `observeWorkspaces`, `workspaces`, `workspace`, `workspaceForRoot`, `saveWorkspaceForRuntime`, `deleteUnreferencedWorkspace`, `session`, `sessionForConversation`, `observeSessions`, `saveSessionForRuntime`, `observeLegacyConversations`, `conversations`, `legacyMessagePreviews`, `legacyMessageChunk`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: HarnessInstallationDao (17 abstract methods) app/src/main/java/com/example/llamadroid/data/db/HarnessInstallationDao.kt:20 — `HarnessInstallationDao` declares 17 abstract methods: `observeAll`, `getAll`, `getById`, `observeById`, `insert`, `update`, `markReady`, `updateSize`, `deleteById`, `deleteConversationsForRuntime`, `deleteRuntimeJobsForRuntime`, `deleteSessionsForRuntime`, `deleteWorkspacesForRuntime`, `deleteTransferReceiptsForRuntime`, `countExternalRuntimeReferences`, `deleteRuntimeProcessRow`, `deleteEnvironmentIfUnreferenced`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: KnowledgeBaseDao (44 abstract methods) app/src/main/java/com/example/llamadroid/data/db/KnowledgeBaseDao.kt:12 — `KnowledgeBaseDao` declares 44 abstract methods: `observeKnowledgeBases`, `getKnowledgeBasesOnce`, `getKnowledgeBase`, `getKnowledgeBaseByName`, `getKnowledgeBasesByIds`, `insertKnowledgeBase`, `updateKnowledgeBase`, `deleteKnowledgeBaseById`, `observeSources`, `getSourcesOnce`, `getAllSourcesOnce`, `getSource`, `getSourcesByIds`, `getSourceByRef`, `insertSource`, `updateSource`, `deleteSource`, `deleteSourceById`, `setSourceEnabled`, `updateSourceProgress`, `markIndexedSourcesStaleForConfig`, `deleteChunksForSource`, `insertChunks`, `updateChunkEmbedding`, `getSearchableChunks`, `getChunk`, `getChunksForSource`, `getChunksForSourcePaged`, `getChunksMissingEmbedding`, `getNeighborChunks`, `observeKnowledgeBaseCount`, `getKnowledgeBaseCount`, `observeSourceCount`, `observeSourceCountExcluding`, `observeChunkCount`, `observeChunkCountExcluding`, `observeErrorSourceCount`, `observeErrorSourceCountExcluding`, `observePendingSourceCount`, `observePendingSourceCountExcluding`, and 4 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: ModelLibraryDao (35 abstract methods) app/src/main/java/com/example/llamadroid/data/db/ModelLibraryEntities.kt:177 — `ModelLibraryDao` declares 35 abstract methods: `observeSources`, `observeSourcesByFamily`, `getSourceById`, `getByNormalizedKey`, `upsert`, `invalidateSourceInstallationEvidence`, `invalidateSourceBundleEvidence`, `invalidateSourcePendingPayloads`, `upsertSources`, `deleteSourceById`, `observeProvenance`, `observeProvenanceBySource`, `getProvenanceBySource`, `updateProvenanceReference`, `getByModelKey`, `deleteProvenanceById`, `deleteByModelKey`, `observeBundles`, `observeBundlesByFamily`, `getBundleById`, `deleteBundleById`, `getForBundle`, `observeForBundle`, `getBundleItemById`, `upsertBundleItems`, `deleteBundleItemById`, `deleteForBundle`, `getWithItems`, `observePendingArtifacts`, `observeByStatuses`, `getPendingArtifactById`, `getPendingArtifactsForBundle`, `getByDownloadTaskId`, `upsertPendingArtifacts`, `deletePendingArtifactById`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: OrganizerDao (22 abstract methods) app/src/main/java/com/example/llamadroid/data/db/OrganizerDao.kt:12 — `OrganizerDao` declares 22 abstract methods: `getAllEvents`, `getAllEventsOnce`, `getEventsInRange`, `getEventsInRangeOnce`, `getEventById`, `insertEvent`, `updateEvent`, `deleteEvent`, `deleteEventById`, `getAllAlarms`, `getAllAlarmsOnce`, `getAlarmsForEventOnce`, `getAlarmById`, `getEnabledFutureAlarms`, `insertAlarm`, `updateAlarm`, `deleteAlarm`, `deleteAlarmById`, `markAlarmDelivered`, `getLlmSettings`, `getLlmSettingsOnce`, `upsertLlmSettings`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: SdDistributedDao (21 abstract methods) app/src/main/java/com/example/llamadroid/data/db/SdDistributedEntities.kt:196 — `SdDistributedDao` declares 21 abstract methods: `observeWorkers`, `observeEnabledWorkers`, `observeWorkersOrdered`, `getEnabledWorkersOnce`, `getMaxWorkerSortOrder`, `upsertWorker`, `updateWorker`, `deleteWorker`, `setWorkerEnabled`, `setWorkerSortOrder`, `observeMasterSettings`, `getMasterSettings`, `upsertMasterSettings`, `observeTemplates`, `upsertTemplate`, `deleteTemplate`, `observePlacements`, `upsertPlacement`, `deletePlacement`, `observeRecentRuns`, `insertRun`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: HarnessTransferDao (20 abstract methods) app/src/main/java/com/example/llamadroid/harness/HarnessTransferMetadata.kt:882 — `HarnessTransferDao` declares 20 abstract methods: `workspaces`, `sessions`, `conversations`, `messagesForConversations`, `messagePartsForConversations`, `allWorkspaceIds`, `allConversationIds`, `sessionIds`, `messageOriginalIds`, `messagePartIds`, `receipt`, `harnessWorkspaceIds`, `activeJobCount`, `activeRunCount`, `insertWorkspaces`, `insertConversations`, `insertSessions`, `insertMessages`, `insertMessageParts`, `insertReceipt`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: FarmDao (16 abstract methods) app/src/main/java/com/example/llamadroid/tama/db/FarmDao.kt:39 — `FarmDao` declares 16 abstract methods: `observeTiles`, `getTiles`, `saveTile`, `saveTiles`, `observeUpgrades`, `getUpgrades`, `getUpgrade`, `saveUpgrade`, `saveUpgrades`, `observeLivestock`, `getLivestock`, `getLivestockByType`, `saveLivestock`, `clearTilesForPet`, `clearUpgradesForPet`, `clearLivestockForPet`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: TamaDao (132 abstract methods) app/src/main/java/com/example/llamadroid/tama/db/TamaDao.kt:427 — `TamaDao` declares 132 abstract methods: `getPet`, `observePet`, `getActivePet`, `observeActivePet`, `getAllPetIds`, `savePet`, `deletePet`, `updateStats`, `updateMoney`, `updateLocation`, `updateActivityStatus`, `saveEvent`, `saveEvents`, `getRecentEvents`, `observeRecentEvents`, `getAllEvents`, `getEventsSince`, `deleteEventsForPet`, `saveQuest`, `saveQuests`, `getQuestsForPet`, `getQuestsByStatus`, `deleteStaleAvailableQuests`, `deleteQuestsForPet`, `saveQuestChecklistItem`, `saveQuestChecklistItems`, `observeQuestChecklist`, `getQuestChecklist`, `getQuestChecklistItem`, `deleteQuestChecklistItem`, `deleteCheckedQuestChecklistItems`, `deleteQuestChecklistForPet`, `saveDeepDreamRun`, `saveDeepDreamRuns`, `getDeepDreamRun`, `getDeepDreamRunBySignature`, `getDeepDreamRunByAlbumId`, `getDeepDreamRunsForPet`, `getDeepDreamRunsForPetByStatuses`, `getDeepDreamRunsByStatuses`, and 92 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×7
  • Hand-rolled JSON/XML parsing via regex app/src/main/java/com/example/llamadroid/service/AgentDirectRuntimeSupport.kt:395 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex app/src/main/java/com/example/llamadroid/service/AgentPlanProposalRecovery.kt:64 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex app/src/main/java/com/example/llamadroid/service/AgentService.kt:16529 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex app/src/main/java/com/example/llamadroid/service/AgentService.kt:16561 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex app/src/main/java/com/example/llamadroid/service/AgentService.kt:16586 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:427 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex app/src/main/java/com/example/llamadroid/service/RemoteSummaryClient.kt:431 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found wear/build.gradle.kts:2 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `wear/build.gradle.kts` makes this repository a deployable product (line 2).
D21 · Naming Consistency · `importSDModel` spells `SD` where 292 names in the project spell it `Sd` · ×1
  • `importSDModel` spells `SD` where 292 names in the project spell it `Sd` app/src/main/java/com/example/llamadroid/data/model/LocalModelImports.kt:22 — 292 of 296 names in project app spell the token `Sd` (292 of 296; unit: names in project app containing `Sd`). Peers: SettingsRepository.setSdTxt2imgThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1765); SettingsRepository.setSdImg2imgThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1774); SettingsRepository.setSdUpscaleThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1783); SettingsRepository.setSdMaxCpuRamEnabled (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:2927); SettingsRepository.setSdMaxCpuRamGiB (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:2934). Rename to `importSdModel`. [rule N6]
D21 · Naming Consistency · `getLLMModels` spells `LLM` where 57 names in the project spell it `Llm` · ×1
  • `getLLMModels` spells `LLM` where 57 names in the project spell it `Llm` app/src/main/java/com/example/llamadroid/data/model/ModelRepository.kt:155 — 57 of 59 names in project app spell the token `Llm` (57 of 59; unit: names in project app containing `Llm`). Peers: LlamaApplication.runRemovedLlmTrainingCleanupOnce (app/src/main/java/com/example/llamadroid/LlamaApplication.kt:239); LlamaApplication.cancelRemovedLlmTrainingWork (app/src/main/java/com/example/llamadroid/LlamaApplication.kt:258); LlamaApplication.removedLlmTrainingWorkIdsFromWorkDb (app/src/main/java/com/example/llamadroid/LlamaApplication.kt:266); LlamaApplication.deleteRemovedLlmTrainingRuntimeFiles (app/src/main/java/com/example/llamadroid/LlamaApplication.kt:293); SettingsRepository._selectedLlmLoras (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:775). Rename to `getLlmModels`. [rule N6]
D21 · Naming Consistency · `callLLM` spells `LLM` where 57 names in the project spell it `Llm` · ×1
  • `callLLM` spells `LLM` where 57 names in the project spell it `Llm` app/src/main/java/com/example/llamadroid/service/DatasetProcessor.kt:576 — 57 of 59 names in project app spell the token `Llm` (57 of 59; unit: names in project app containing `Llm`). Peers: LlamaApplication.runRemovedLlmTrainingCleanupOnce (app/src/main/java/com/example/llamadroid/LlamaApplication.kt:239); LlamaApplication.cancelRemovedLlmTrainingWork (app/src/main/java/com/example/llamadroid/LlamaApplication.kt:258); LlamaApplication.removedLlmTrainingWorkIdsFromWorkDb (app/src/main/java/com/example/llamadroid/LlamaApplication.kt:266); LlamaApplication.deleteRemovedLlmTrainingRuntimeFiles (app/src/main/java/com/example/llamadroid/LlamaApplication.kt:293); SettingsRepository._selectedLlmLoras (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:775). Rename to `callLlm`. [rule N6]
D21 · Naming Consistency · `performOCR` spells `OCR` where 188 names in the project spell it `Ocr` · ×1
  • `performOCR` spells `OCR` where 188 names in the project spell it `Ocr` app/src/main/java/com/example/llamadroid/service/PDFService.kt:7599 — 188 of 189 names in project app spell the token `Ocr` (188 of 189; unit: names in project app containing `Ocr`). Peers: PdfTranslationOptionsSnapshot.bubbleGuidedOcrEnabled (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:91); PdfTranslationOptionsSnapshot.llamaOcr (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:92); com.example.llamadroid.data.PdfOcrProvider (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:101); com.example.llamadroid.data.LlamaOcrPromptPreset (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:106); com.example.llamadroid.data.LlamaOcrSettingsSnapshot (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:163). Rename to `performOcr`. [rule N6]
D21 · Naming Consistency · `startSDServer` spells `SD` where 292 names in the project spell it `Sd` · ×1
  • `startSDServer` spells `SD` where 292 names in the project spell it `Sd` app/src/main/java/com/example/llamadroid/service/SDEnvironmentService.kt:230 — 292 of 296 names in project app spell the token `Sd` (292 of 296; unit: names in project app containing `Sd`). Peers: SettingsRepository.setSdTxt2imgThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1765); SettingsRepository.setSdImg2imgThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1774); SettingsRepository.setSdUpscaleThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1783); SettingsRepository.setSdMaxCpuRamEnabled (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:2927); SettingsRepository.setSdMaxCpuRamGiB (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:2934). Rename to `startSdServer`. [rule N6]
D21 · Naming Consistency · `stopSDServer` spells `SD` where 292 names in the project spell it `Sd` · ×1
  • `stopSDServer` spells `SD` where 292 names in the project spell it `Sd` app/src/main/java/com/example/llamadroid/service/SDEnvironmentService.kt:265 — 292 of 296 names in project app spell the token `Sd` (292 of 296; unit: names in project app containing `Sd`). Peers: SettingsRepository.setSdTxt2imgThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1765); SettingsRepository.setSdImg2imgThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1774); SettingsRepository.setSdUpscaleThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1783); SettingsRepository.setSdMaxCpuRamEnabled (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:2927); SettingsRepository.setSdMaxCpuRamGiB (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:2934). Rename to `stopSdServer`. [rule N6]
D21 · Naming Consistency · `InstalledSDModelsTab` spells `SD` where 292 names in the project spell it `Sd` · ×1
  • `InstalledSDModelsTab` spells `SD` where 292 names in the project spell it `Sd` app/src/main/java/com/example/llamadroid/ui/ai/SDModelsScreen.kt:700 — 292 of 296 names in project app spell the token `Sd` (292 of 296; unit: names in project app containing `Sd`). Peers: SettingsRepository.setSdTxt2imgThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1765); SettingsRepository.setSdImg2imgThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1774); SettingsRepository.setSdUpscaleThreads (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:1783); SettingsRepository.setSdMaxCpuRamEnabled (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:2927); SettingsRepository.setSdMaxCpuRamGiB (app/src/main/java/com/example/llamadroid/data/SettingsRepository.kt:2934). Rename to `InstalledSdModelsTab`. [rule N6]
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion app/build.gradle.kts:1 — `app` (511158 LoC, 7517 module-visible types across 95 directories) overshoots its size bounds. 1 of 4 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 5.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation app/build.gradle.kts:407 — `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`.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X2 · Cancellation propagation · Not all functions that make a request accept an AbortSignal or the coroutine's cancellation · ×1
  • Not all functions that make a request accept an AbortSignal or the coroutine's cancellation — Only 3/26 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; Ktor, OkHttp newCall, URL streams) accept an AbortSignal or the coroutine's cancellation or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` () and hand it to the request; in a Kotlin suspend function, make the request with a call that suspends — Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` that cancels the `Call` — not a blocking `execute()`: `withContext(Dispatchers.IO)` moves the call off the caller's thread but does not make it cancellable; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-e1d9a039eaab4bb1bb3031d938227309/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-e1d9a039eaab4bb1bb3031d938227309/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .33artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—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.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—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.0—
D41 · Kernel & Syscall Confinementruntime-hardening—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.0—
D42 · Runtime Threat Enforcementruntime-hardening—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.0—
D43 · Malicious Dependenciesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).0—

Run 01a1ea83-1465-75eb-8c73-85670f535563 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md