Public report of ganjmeng/dazz-retro-camera, published 17 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 17 November 2026, 17:36 UTC · Survey ID cd_874b8b4c7e474a4c868aaa10277f9eae
ganjmeng/dazz-retro-camera
Measured 17 November 2026, 17:35 UTC, at code version c8a7f26
Bus factor is not measured: No living knowledge left to concentrate.
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 43,075 lines of product code in 6 projects, tests not counted · Estimated rebuild effort: about 0.3 person-years · Weakest lens: Production Readiness, 44.6
Findings by how serious they are
28 critical413 serious87 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
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 17:35 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 ▸
49of 49 dimensions measured by tools.
519of 528 findings point to an exact file and line, so you can open each one in the code. The other 9 concern the repository as a whole, such as missing documentation.
49dimensions across 6 lenses, read from 43,075 lines of product code in 6 projects.
ganjmeng/dazz-retro-camera falls short of our standard for production because its Git mining dimensions are rated Critical, and we found no logging, tracing or health checks in the code. It scores 53.8 out of 100, which alone would earn Adequate, but it is rated Weak: a rating can't sit more than one step above its weakest group.
Production Readiness, at 44.6, is the weakest lens and counts most in the score. The best first steps are adding a diagnostic log and adding automated security scanning, each worth about 7.2 points. Raising Production Readiness to 70 would lift the score to about 61.6.
Twenty-four pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Three secrets can leak from the build pipeline, and one pipeline step puts outside input straight into a shell command, so an attacker can run commands in the build pipeline. Pinning each tool to an exact version, limiting each secret to its own step and passing outside input through environment variables would close these risks.
The product code is 43,075 lines, about €51,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 44.6 to 70, the lowest score rated Strong, the score would rise from 53.8 to about 61.6.
Code composition: what the lines of code are
Product code 92%Tests 8%
Rebuild cost: about €51,000 · Estimate
Cost to rebuild
€17,000 to €84,000, for 280 to 887 hours of work, about 0.3 person-years for one engineer
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 54. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 43,075 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Write a diagnostic trail the user can hand back with a bug report: log through `package:logging` to a file in the app's support directory that a report can attach.
Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
Raises the score by about 7.2 points · Medium effort · Observability
2
Add a SAST step to CI running what this repository's stack ships: the Dart analyzer's security lints plus `semgrep --config=auto` — so a security regression fails the build instead of landing.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.dart.
Raises the score by about 2.8 points · Low effort · ADR Quality
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 €51,000 to build again, about 0.3 person-years of work. Its weakest lens is Production Readiness, at 44.6 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Write a diagnostic trail the user can hand back with a bug report: log through `package:logging` to a file in the app's support directory that a report can attach. Of all the actions in this report, it raises the score most for the work it takes: about 7.2 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.3 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 7% to 15% on every change. The history of the code shows how much it changes: about 1,942,956 lines over the last 90 days, which is about 7,879,766 lines a year. At that pace, the extra work comes to an estimated 1335.7 to 8014 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
23 modules, with 10 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
com.retrocam.app.camera uses com.retrocam.app.camera.MotionPhotoPackaging, so a change to com.retrocam.app.camera.MotionPhotoPackaging can break com.retrocam.app.camera, while a change to com.retrocam.app.camera can't break com.retrocam.app.camera.MotionPhotoPackaging.
Position
Below the diagonal: com.retrocam.app.camera uses a module listed above it, which is the healthy direction.
com.retrocam.app.managers uses com.retrocam.app.renderers, so a change to com.retrocam.app.renderers can break com.retrocam.app.managers, while a change to com.retrocam.app.managers can't break com.retrocam.app.renderers.
Position
Below the diagonal: com.retrocam.app.managers uses a module listed above it, which is the healthy direction.
com.retrocam.app.models.Preset uses com.retrocam.app.models, so a change to com.retrocam.app.models can break com.retrocam.app.models.Preset, while a change to com.retrocam.app.models.Preset can't break com.retrocam.app.models.
Position
Below the diagonal: com.retrocam.app.models.Preset uses a module listed above it, which is the healthy direction.
repository.services uses repository.models, so a change to repository.models can break repository.services, while a change to repository.services can't break repository.models.
Position
Below the diagonal: repository.services uses a module listed above it, which is the healthy direction.
21→23 repository.services uses repository.featurespart of a loop✕
Connections
4 pairs of types, where a type in repository.services uses a type in repository.features.
repository.services uses repository.features, so a change to repository.features can break repository.services, while a change to repository.services can't break repository.features.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
com.retrocam.app uses com.retrocam.app.renderers, so a change to com.retrocam.app.renderers can break com.retrocam.app, while a change to com.retrocam.app can't break com.retrocam.app.renderers.
Position
Below the diagonal: com.retrocam.app uses a module listed above it, which is the healthy direction.
com.retrocam.app uses com.retrocam.app.managers, so a change to com.retrocam.app.managers can break com.retrocam.app, while a change to com.retrocam.app can't break com.retrocam.app.managers.
Position
Below the diagonal: com.retrocam.app uses a module listed above it, which is the healthy direction.
repository.features uses repository.core, so a change to repository.core can break repository.features, while a change to repository.features can't break repository.core.
Position
Below the diagonal: repository.features uses a module listed above it, which is the healthy direction.
repository.features uses repository.models, so a change to repository.models can break repository.features, while a change to repository.features can't break repository.models.
Position
Below the diagonal: repository.features uses a module listed above it, which is the healthy direction.
repository.features uses repository.services, so a change to repository.services can break repository.features, while a change to repository.features can't break repository.services.
Position
Below the diagonal: repository.features uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 72.3 · Adequate · gated by D2 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
33
High / Critical
A03:2025 — Software Supply Chain Failures
8
Medium
Roadmap
Top priorities: Write a diagnostic trail the user can hand back with a bug report: log through `package:logging` to a file in the app's support directory that a report can attach. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce; Add a SAST step to CI running what this repository's stack ships: the Dart analyzer's security lints plus `semgrep --config=auto` — so a security regression fails the build instead of landing; Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.dart.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Write a diagnostic trail the user can hand back with a bug report: log through `package:logging` to a file in the app's support directory that a report can attach. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
Add a SAST step to CI running what this repository's stack ships: the Dart analyzer's security lints plus `semgrep --config=auto` — so a security regression fails the build instead of landing.
Dart: await the async dart:io API (readAsString, writeAsString, Process.run, Future.delayed) instead of the *Sync variant or sleep(), or move heavy synchronous work to another isolate with Isolate.run.
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 — 28
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 — 413
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 87
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 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 49 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 — 49 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 519 of 528 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.dart) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.dart) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 3 Maven/Gradle manifest(s) were read, stating a version for 20 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Dart pubspec.yaml, but the licence verdict published here was taken over its JVM dependencies. Nothing was read about its Dart dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. All 61 significant source file(s) were last meaningfully changed so long ago that no living knowledge remains — nothing since has been substantial enough to re-establish ownership (a broad, mechanical sweep that touches many files shallowly does not count, and neither does no activity at all). There is no concentration to measure, so the bus factor is not scored. This is not a clean bill: nobody currently holds working knowledge of this code (see D34 Knowledge Freshness). Counted over 61 of the 84 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
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. A language sidecar this run needed FAILED, so the code model the non-MSBuild public-API collector reads was never built — this is a DEGRADED run, not a settled gap, and the surface may well be collectable on a re-run: The Rust sidecar exited 0 and produced a model, but its own source census reports it opened ZERO Rust files — while the engine's presence probe found Rust source in this tree. The model is therefore empty for a reason on OUR side, not the repository's, and Rust is recorded as unread rather than as clean.
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.
D27 Navigability — 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: a native UI project (native_plugin/android/src/main/AndroidManifest.xml). The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
C1 Data Protection — 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 personal data 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 personal data controls.
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.
C3 Audit Trail — 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 audit 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 audit controls.
C4 Data Retention — 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 retention 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 retention controls.
C5 Data-Subject Rights — 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 data-subject rights 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 data-subject rights controls.
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.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, 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.
X26 Unsynchronised callback handoff — 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
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. 1 further occurrence(s) are not listed individually; the score already reflects all 41.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
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.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
44 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was CapturePipeline.process at 183. A further 2 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 CameraPlugin.onMethodCall at 30 — they are counted neither in the figure above nor in this dimension's score.
+ 39 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with CapturePipeline.process (cyclomatic 183). — Refactoring it lifts Cyclomatic Complexity from 4.5 to about 5.1/10.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 59 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 5 bodies over 60 down to 60 or less in Cognitive Complexity — start with CapturePipeline.process (cognitive 355), CameraAppNotifier.takePhoto (cognitive 243), RetroCamPlugin.buildShaderParams (cognitive 187). — 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 5 together lifts Cognitive Complexity from 2.0 to about 5.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.1 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 28 MethodTooLong finding(s) in God Classes — start with REDACTED (7), capture_pipeline.dart (2), camera_notifier.dart (2). — One of this dimension's main actionable groups (28 warning-level).
Resolve the 16 FileTooLong finding(s) in God Classes — start with REDACTED, CameraPlugin.kt, camera_config_sheet.dart. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 15 ClassTooLong finding(s) in God Classes — start with REDACTED (2), gallery_screen.dart (2), CameraPlugin.kt. — One of this dimension's main actionable groups (15 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
104 duplicated block group(s) detected. 10.9 % of the production lines (4,692 of 43,075) are in a reported copy. A further 54 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 6 of the 158 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 95 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 11 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with camera_notifier.dart (3), CameraPlugin.kt (3), REDACTED. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 6 Duplicated block (14 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), camera_config_sheet.dart, CameraSessionManager.swift. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 6 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), camera_config_sheet.dart, capture_pipeline.dart. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
4 production modules (Gradle+pub), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 0 module(s) off the main sequence.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with camera_notifier.dart, grd_camera_notifier.dart, REDACTED. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 5 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 3 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure. A further 14 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. ★ COVERAGE OF THIS VERDICT: it grades this repository's JVM dependencies and nothing else. The repository also declares a Dart pubspec.yaml, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: flutter_app/lib/features/camera/capture_pipeline.dart (94×183=17202); flutter_app/lib/features/camera/camera_notifier.dart (100×88=8800); REDACTED (183×43=7869) Repeated repair below the complexity floor: flutter_app/lib/features/camera/grd_camera_notifier.dart (5 of 7 changes were fixes); flutter_app/lib/models/preset.dart (3 of 5 changes were fixes); flutter_app/ios/Runner/AppDelegate.swift (3 of 4 changes were fixes)
Resolve the 16 Hotspot finding(s) in Churn × Complexity Hotspots — start with MetalRenderer.swift (2), capture_pipeline.dart, camera_notifier.dart. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 4 Repeated repair finding(s) in Churn × Complexity Hotspots — start with grd_camera_notifier.dart, preset.dart, AppDelegate.swift. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
1 deducted task-comment markers across 43075 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 1 TodoComment finding(s) in Explicit Debt — start with subscription_service.dart. — 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.
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.
2 of 2 documentation facets pass in full. 24 document(s) read across 6 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.dart. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
1 of 6 build units (Gradle, Xcode, checkout, pub) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesionflutter_app/pubspec.yaml:1
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with pubspec.yaml. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
33 finding(s): 0 critical, 28 high, 1 medium, 4 low. 24 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 1 file(s) — `flutter_app/android/gradlew` (lines 140–141, line 142, line 143, …) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 24 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 (24 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
61 of 61 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is REDACTED. Counted over 61 of the 84 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 58 Orphaned file finding(s) in Knowledge Freshness — start with MetalRenderer.swift (2), CameraSessionManager.swift (2), camera_config_sheet.dart. — One of this dimension's main actionable groups (58 recommendation-level).
Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with REDACTED, CameraPlugin.kt, camera_notifier.dart. — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 Dormant codebase finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 3 Change coupling finding(s) in Change Coupling — start with CameraPlugin.kt, CameraGLRenderer.kt, CaptureGLProcessor.kt. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 20 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — Whether any singleton service captures a scoped/transient dependency — a silent lifetime/threading bug.
Method: Roslyn scan: DI registrations parsed from AddSingleton/Scoped/Transient; each singleton checked for captured shorter-lifetime dependencies. Exhaustive, deterministic.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Do you agree with this assessment?
AX7 · Slice cohesion4.0 / 10Weak✓ Tool-verified
Other · Architecture — Whether feature slices stay independent (no direct cross-slice references) — the discipline that makes vertical-slice architecture pay off.
Method: Roslyn scan (vertical-slice gated): feature slices resolved from namespaces (.Features.*, .Slices.*) or project names; cross-slice type references detected. Deterministic, traceable.
`_RenderModeSegment` (slice 'settings') depends on `RenderStyleMode` from slice 'camera'. — flutter_app/lib/features/settings/settings_screen.dart:730
`_PreviewModeSegment` (slice 'settings') depends on `PreviewPerformanceMode` from slice 'camera'. — flutter_app/lib/features/settings/settings_screen.dart:770
What to do
Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Code Health — Unreviewed-generation residue in this repository's Dart: methods whose whole body still throws UnimplementedError or a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Dart: methods that only throw UnimplementedError or a "not implemented" exception, methods that take inputs and return a constant or do nothing, dead `if (false)` branches, and skeleton classes most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
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.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.
What to do
Write a diagnostic trail the user can hand back with a bug report: log through `package:logging` to a file in the app's support directory that a report can attach. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add the Dart analyzer's security lints plus `semgrep --config=auto` as a CI step. What was searched, so you can tell an absence from a miss: the 5 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:6
`flutter_app/android/app/build.gradle` 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`. — flutter_app/android/app/build.gradle:45
What to do
Add a SAST step to CI running what this repository's stack ships: the Dart analyzer's security lints plus `semgrep --config=auto` — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
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.
`takePhoto` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — flutter_app/lib/features/camera/camera_notifier.dart:1321
`_runBackgroundEnhanceAndReplace` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — flutter_app/lib/features/camera/camera_notifier.dart:1857
`process` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — flutter_app/lib/features/camera/capture_pipeline.dart:124
`blendDoubleExposure` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — flutter_app/lib/features/camera/capture_pipeline.dart:2086
`_save` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — flutter_app/lib/features/image_edit/image_edit_screen.dart:255
What to do
Dart: await the async dart:io API (readAsString, writeAsString, Process.run, Future.delayed) instead of the *Sync variant or sleep(), or move heavy synchronous work to another isolate with Isolate.run.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. 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 … in` loop leaves the `List`, `Map` or `Set` it is walking alone — Dart's collection iterators check that the collection has not changed since the loop began, so a body that adds to or removes from the very collection the loop is walking (or the map whose `keys`, `values` or `entries` it walks) makes the next step throw `ConcurrentModificationError` and the remaining elements are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch (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. — native_plugin/android/src/main/kotlin/com/retrocam/app/models/Preset.kt:73
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. (×28) — flutter_app/lib/services/retain_settings_service.dart:133, flutter_app/lib/features/image_edit/image_edit_screen.dart:43, flutter_app/lib/features/image_edit/image_edit_screen.dart:389, …
`catch (_)` 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) — flutter_app/lib/services/retain_settings_service.dart:178, flutter_app/lib/models/camera_definition.dart:172, flutter_app/lib/models/camera_definition.dart:181, …
An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch. — flutter_app/lib/features/image_edit/image_edit_screen.dart:240
Other · Code Health — Whether Dart's sound null safety is on and is not undermined by null assertions — a package whose `environment: sdk:` lower bound is 2.12 or above is null safe, so `String` cannot hold null and `String?` must be checked before use, and each postfix `!` is a run-time `Null check operator used on a null value` the author has told the analyzer cannot happen.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 1 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 12 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 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 — Not assessed: these audit 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 audit 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.
C4 Data Retention — Not assessed: these retention 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 retention 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.
C5 Data-Subject Rights — Not assessed: these data-subject rights 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 data-subject rights 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.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 64 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. Dart isolates share no mutable memory, so no two requests write one object at the same instant.
AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
AX6 Interface segregation — no public interfaces
AX8 Test isolation — no test/production split to check
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data 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 personal data 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.
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 — ~3719 lines of test source are present (.dart) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — no .dart test runner
D12 Dependency Hygiene — Not scored — 3 Maven/Gradle manifest(s) were read, stating a version for 20 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
D16 Bus Factor — dormant codebase — no living knowledge left to concentrate
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — N/A — too few peers to establish a naming convention (5959 declarations, no unit with a dominant convention).
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .dart, .java, .kt, .py, .rs, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.dart), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
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 Dart pubspec.yaml — 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.
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 Dart pubspec.yaml — not scanned yet).
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (6 value object(s))
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, which this analysis does not build from source alone for this language. Reported as guidance rather than measured
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
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Dart, JVM, Python, Rust, Swift source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for classes extending benchmark_harness's `BenchmarkBase`, `AsyncBenchmarkBase` or `PerfBenchmarkBase` (directly or through a base of your own), `benchmark(…)` calls under the pub `benchmark` package, Flutter's `benchmarkWidgets`, `watchPerformance` or `traceAction` in a test importing flutter_test, integration_test or flutter_driver, or benchmark_harness, benchmark or web_benchmarks in a pubspec.yaml, 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 — No web surface: 46 Dart file(s) were read for weak hashes and ciphers, key material fixed in the source and disabled TLS certificate validation, and none was found. This repository serves no HTTP of its own — no server framework among its pubspec dependencies, no `HttpServer` bound and no shelf, dart_frog or serverpod import in its production source or `bin/`, no web build target — so HTTPS enforcement, HSTS, cookie flags and input validation are N/A here, as they are for a C# library or worker. If this codebase starts serving HTTP, the dimension reactivates automatically.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — 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
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
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — X26 reached only 31% of this repository's production lines — dart (29,236 lines), rust (373 lines), c (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Dart was read, and it logs through none: package:logging, package:logger, talker and dart:developer take one finished message and no template arguments or fields (as log4net does in C#), so an interpolated message there loses nothing the API could have kept. Sentry's structured logs (`Sentry.logger`) would be judged.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Swallowed exception (empty catch) flutter_app/lib/services/retain_settings_service.dart:133— 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) flutter_app/lib/features/image_edit/image_edit_screen.dart:43— 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) flutter_app/lib/features/image_edit/image_edit_screen.dart:240— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
Swallowed exception (empty catch) flutter_app/lib/features/image_edit/image_edit_screen.dart:389— 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) flutter_app/lib/features/image_edit/image_edit_screen.dart:394— 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) flutter_app/lib/features/image_edit/image_edit_screen.dart:399— 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) flutter_app/lib/features/image_edit/image_edit_screen.dart:1519— 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) flutter_app/lib/features/image_edit/image_edit_screen.dart:1612— 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) flutter_app/lib/features/image_edit/image_edit_screen.dart:1914— 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) flutter_app/lib/features/image_edit/image_edit_screen.dart:2144— 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) flutter_app/lib/features/camera/camera_config_sheet.dart:2706— 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) flutter_app/lib/features/camera/camera_notifier.dart:1614— 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) flutter_app/lib/features/camera/camera_notifier.dart:1619— 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) flutter_app/lib/features/camera/camera_notifier.dart:1930— 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) flutter_app/lib/features/camera/camera_notifier.dart:1935— 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) REDACTED:4385— 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) REDACTED:4460— 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) REDACTED:5942— 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) flutter_app/lib/features/camera/capture_pipeline.dart:218— 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) flutter_app/lib/features/camera/capture_pipeline.dart:547— 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) flutter_app/lib/features/camera/capture_pipeline.dart:609— 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) flutter_app/lib/features/camera/capture_pipeline.dart:614— 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) flutter_app/lib/features/camera/capture_pipeline.dart:686— 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) flutter_app/lib/features/camera/capture_pipeline.dart:704— 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) flutter_app/lib/features/camera/capture_pipeline.dart:989— 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.
MethodTooLong: CapturePipeline.process flutter_app/lib/features/camera/capture_pipeline.dart:124— MethodTooLong — process runs 678 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 578 over it, 6.78× 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: CameraAppNotifier.takePhoto flutter_app/lib/features/camera/camera_notifier.dart:1321— MethodTooLong — takePhoto runs 430 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 330 over it, 4.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _SubPanelState._buildWatermarkContent flutter_app/lib/features/camera/camera_config_sheet.dart:980— MethodTooLong — _buildWatermarkContent runs 294 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 194 over it, 2.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: _CameraScreenState.build REDACTED:1382— MethodTooLong — build runs 281 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 181 over it, 2.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SettingsScreen.build flutter_app/lib/features/settings/settings_screen.dart:211— MethodTooLong — build runs 216 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 116 over it, 2.16× 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: _CameraScreenState._buildTopMenuOverlay REDACTED:2946— MethodTooLong — _buildTopMenuOverlay runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _CameraScreenState._buildViewfinderArea REDACTED:1772— MethodTooLong — _buildViewfinderArea runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.02× 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: _PhotoDetailPageState.build flutter_app/lib/features/gallery/gallery_screen.dart:1570— MethodTooLong — build runs 192 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 92 over it, 1.92× 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: _CameraSampleScreenState.build flutter_app/lib/features/camera/camera_sample_screen.dart:69— MethodTooLong — build runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.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: CameraAppState.copyWith flutter_app/lib/features/camera/camera_notifier.dart:189— MethodTooLong — copyWith runs 162 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 62 over it, 1.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: _CameraScreenState._buildShutterRow REDACTED:2667— MethodTooLong — _buildShutterRow runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CameraPlugin.handleSyncCameraState flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2185— MethodTooLong — handleSyncCameraState runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CaptureGLProcessor.setUniforms flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1561— MethodTooLong — setUniforms runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CapturePipeline._drawWatermark flutter_app/lib/features/camera/capture_pipeline.dart:1883— MethodTooLong — _drawWatermark runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MetalRenderer.updateParams flutter_app/ios/Runner/Camera/MetalRenderer.swift:283— MethodTooLong — updateParams runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CameraPlugin.bindCameraUseCases flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:356— MethodTooLong — bindCameraUseCases runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.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: CameraGLRenderer.renderFrame flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt:1145— MethodTooLong — renderFrame runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _OptionsSheet._buildOptionRow REDACTED:3600— MethodTooLong — _buildOptionRow runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× 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: _ImageEditScreenState._buildPreviewArea flutter_app/lib/features/image_edit/image_edit_screen.dart:574— MethodTooLong — _buildPreviewArea runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _WatermarkPainter.paint REDACTED:5928— MethodTooLong — paint runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CameraGLRenderer.updateParams flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt:1325— MethodTooLong — updateParams runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.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: RetroCamPlugin.prepareLivePhotoVideoForSaving flutter_app/ios/Runner/Camera/CameraPlugin.swift:836— MethodTooLong — prepareLivePhotoVideoForSaving runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _SubPanelState.build flutter_app/lib/features/camera/camera_config_sheet.dart:698— MethodTooLong — build runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _CameraInfoPanel.build flutter_app/lib/features/camera/camera_sample_screen.dart:385— MethodTooLong — build runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× 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: PreviewRenderParams.toJson flutter_app/lib/features/camera/preview_renderer.dart:939— MethodTooLong — toJson runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.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.
Hotspot: flutter_app/lib/features/camera/capture_pipeline.dart flutter_app/lib/features/camera/capture_pipeline.dart:124— flutter_app/lib/features/camera/capture_pipeline.dart changed 94 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 183 in CapturePipeline.process at line 124. 45 of those changes were fix/bug commits, and the other 49 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/lib/features/camera/capture_pipeline.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: flutter_app/lib/features/camera/camera_notifier.dart flutter_app/lib/features/camera/camera_notifier.dart:1321— flutter_app/lib/features/camera/camera_notifier.dart changed 100 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in CameraAppNotifier.takePhoto at line 1321. 43 of those changes were fix/bug commits, and the other 57 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/lib/features/camera/camera_notifier.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:807— REDACTED changed 183 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in _CameraScreenState._classifySceneHintKey at line 807. 98 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: flutter_app/ios/Runner/Camera/CameraPlugin.swift flutter_app/ios/Runner/Camera/CameraPlugin.swift:1763— flutter_app/ios/Runner/Camera/CameraPlugin.swift changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in RetroCamPlugin.buildShaderParams at line 1763. 23 of those changes were fix/bug commits, and the other 29 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/ios/Runner/Camera/CameraPlugin.swift`: 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: flutter_app/ios/Runner/Camera/MetalRenderer.swift flutter_app/ios/Runner/Camera/MetalRenderer.swift:283— flutter_app/ios/Runner/Camera/MetalRenderer.swift changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 87 in MetalRenderer.updateParams at line 283. 14 of those changes were fix/bug commits, and the other 18 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/ios/Runner/Camera/MetalRenderer.swift`: 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: flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1445— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt changed 100 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in CameraPlugin.buildMotionPhotoVideoEffects at line 1445. 48 of those changes were fix/bug commits, and the other 52 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.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: flutter_app/lib/features/camera/preview_renderer.dart flutter_app/lib/features/camera/preview_renderer.dart:243— flutter_app/lib/features/camera/preview_renderer.dart changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in PreviewRenderParams.sceneClass at line 243. 22 of those changes were fix/bug commits, and the other 28 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/lib/features/camera/preview_renderer.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: flutter_app/lib/models/camera_definition.dart flutter_app/lib/models/camera_definition.dart:569— flutter_app/lib/models/camera_definition.dart changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in DefaultLook.toJson at line 569. 14 of those changes were fix/bug commits, and the other 22 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/lib/models/camera_definition.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: flutter_app/lib/features/camera/camera_config_sheet.dart flutter_app/lib/features/camera/camera_config_sheet.dart:980— flutter_app/lib/features/camera/camera_config_sheet.dart changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in _SubPanelState._buildWatermarkContent at line 980. 23 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/lib/features/camera/camera_config_sheet.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1561— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in CaptureGLProcessor.setUniforms at line 1561. 16 of those changes were fix/bug commits, and the other 20 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.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: flutter_app/lib/services/camera_service.dart flutter_app/lib/services/camera_service.dart:787— flutter_app/lib/services/camera_service.dart changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in CameraService._onNativeEvent at line 787. 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/lib/services/camera_service.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: flutter_app/lib/features/gallery/gallery_screen.dart flutter_app/lib/features/gallery/gallery_screen.dart:206— flutter_app/lib/features/gallery/gallery_screen.dart changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in _LivePhotoSupport._resolvePlaybackPath at line 206. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/lib/features/gallery/gallery_screen.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: flutter_app/lib/features/image_edit/image_edit_screen.dart flutter_app/lib/features/image_edit/image_edit_screen.dart:255— flutter_app/lib/features/image_edit/image_edit_screen.dart changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in _ImageEditScreenState._save at line 255. 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/lib/features/image_edit/image_edit_screen.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: flutter_app/ios/Runner/Camera/CaptureProcessor.swift flutter_app/ios/Runner/Camera/CaptureProcessor.swift:183— flutter_app/ios/Runner/Camera/CaptureProcessor.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in CaptureProcessor.processImage at line 183. 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/ios/Runner/Camera/CaptureProcessor.swift`: 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: flutter_app/ios/Runner/Camera/CameraSessionManager.swift flutter_app/ios/Runner/Camera/CameraSessionManager.swift:237— flutter_app/ios/Runner/Camera/CameraSessionManager.swift changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in CameraSessionManager.setWhiteBalance at line 237. 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/ios/Runner/Camera/CameraSessionManager.swift`: 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: native_plugin/ios/Classes/MetalRenderer.swift native_plugin/ios/Classes/MetalRenderer.swift:94— native_plugin/ios/Classes/MetalRenderer.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in MetalRenderer.updateParams at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- native_plugin/ios/Classes/MetalRenderer.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
FileTooLong: REDACTED REDACTED— FileTooLong — 4400 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3900 over it, 8.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: camera/CameraPlugin.kt flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt— FileTooLong — 2270 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: CameraPlugin (74-3077). The bar is 500 significant lines; this is 1770 over it, 4.54× 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: camera/camera_config_sheet.dart flutter_app/lib/features/camera/camera_config_sheet.dart— FileTooLong — 1912 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1412 over it, 3.82× 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: camera/camera_notifier.dart flutter_app/lib/features/camera/camera_notifier.dart— FileTooLong — 1880 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: CameraAppNotifier (414-2346). The bar is 500 significant lines; this is 1380 over it, 3.76× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: camera/capture_pipeline.dart flutter_app/lib/features/camera/capture_pipeline.dart— FileTooLong — 1738 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: CapturePipeline (33-2141). The bar is 500 significant lines; this is 1238 over it, 3.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: core/l10n.dart flutter_app/lib/core/l10n.dart— FileTooLong — 1715 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: Map (355-1990). The bar is 500 significant lines; this is 1215 over it, 3.43× 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: image_edit/image_edit_screen.dart flutter_app/lib/features/image_edit/image_edit_screen.dart— FileTooLong — 1535 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1035 over it, 3.07× 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: Camera/CameraPlugin.swift flutter_app/ios/Runner/Camera/CameraPlugin.swift— FileTooLong — 1392 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: RetroCamPlugin (26-1885). The bar is 500 significant lines; this is 892 over it, 2.78× 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: camera/CaptureGLProcessor.kt flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt— FileTooLong — 1391 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: CaptureGLProcessor (44-1853). The bar is 500 significant lines; this is 891 over it, 2.78× 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: gallery/gallery_screen.dart flutter_app/lib/features/gallery/gallery_screen.dart— FileTooLong — 1348 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 848 over it, 2.70× 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: camera/CameraGLRenderer.kt flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt— FileTooLong — 1259 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: CameraGLRenderer (37-1677). The bar is 500 significant lines; this is 759 over it, 2.52× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: models/camera_definition.dart flutter_app/lib/models/camera_definition.dart— FileTooLong — 1077 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 577 over it, 2.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: camera/preview_renderer.dart flutter_app/lib/features/camera/preview_renderer.dart— FileTooLong — 1023 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: PreviewRenderParams (148-1166). The bar is 500 significant lines; this is 523 over it, 2.05× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: settings/settings_screen.dart flutter_app/lib/features/settings/settings_screen.dart— FileTooLong — 675 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 175 over it, 1.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: services/camera_service.dart flutter_app/lib/services/camera_service.dart— FileTooLong — 646 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: CameraService (132-864). The bar is 500 significant lines; this is 146 over it, 1.29× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Camera/MetalRenderer.swift flutter_app/ios/Runner/Camera/MetalRenderer.swift— FileTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: MetalRenderer (93-811). The bar is 500 significant lines; this is 49 over it, 1.10× 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.
ClassTooLong: _CameraScreenState REDACTED:99— ClassTooLong — 2229 significant lines (blank, comment-only and punctuation-only lines excluded), 65 methods. The bar is 400 significant lines; this is 1829 over it, 5.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.
ClassTooLong: CameraPlugin flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:74— ClassTooLong — 2199 significant lines (blank, comment-only and punctuation-only lines excluded), 76 methods. The bar is 400 significant lines; this is 1799 over it, 5.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CapturePipeline flutter_app/lib/features/camera/capture_pipeline.dart:33— ClassTooLong — 1656 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 1256 over it, 4.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CameraAppNotifier flutter_app/lib/features/camera/camera_notifier.dart:414— ClassTooLong — 1412 significant lines (blank, comment-only and punctuation-only lines excluded), 87 methods. The bar is 400 significant lines; this is 1012 over it, 3.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: RetroCamPlugin flutter_app/ios/Runner/Camera/CameraPlugin.swift:26— ClassTooLong — 1375 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 975 over it, 3.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: CaptureGLProcessor flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:44— ClassTooLong — 1372 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 972 over it, 3.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: CameraGLRenderer flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt:37— ClassTooLong — 1239 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 839 over it, 3.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PreviewRenderParams flutter_app/lib/features/camera/preview_renderer.dart:148— ClassTooLong — 813 significant lines (blank, comment-only and punctuation-only lines excluded), 113 methods. The bar is 400 significant lines; this is 413 over it, 2.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.
ClassTooLong: _SubPanelState flutter_app/lib/features/camera/camera_config_sheet.dart:619— ClassTooLong — 769 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 369 over it, 1.92× 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: _ImageEditScreenState flutter_app/lib/features/image_edit/image_edit_screen.dart:113— ClassTooLong — 619 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 219 over it, 1.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CameraService flutter_app/lib/services/camera_service.dart:131— ClassTooLong — 536 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 136 over it, 1.34× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _GalleryScreenState flutter_app/lib/features/gallery/gallery_screen.dart:356— ClassTooLong — 522 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 122 over it, 1.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: MetalRenderer flutter_app/ios/Runner/Camera/MetalRenderer.swift:93— ClassTooLong — 474 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 74 over it, 1.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: _PhotoDetailPageState flutter_app/lib/features/gallery/gallery_screen.dart:1225— ClassTooLong — 444 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 44 over it, 1.11× 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: _OptionsSheet REDACTED:3262— ClassTooLong — 419 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 19 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (5 lines × 2) REDACTED:794— REDACTED:794-798 | REDACTED:973-977 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:794` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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) flutter_app/lib/features/camera/camera_notifier.dart:390— flutter_app/lib/features/camera/camera_notifier.dart:390-394 | flutter_app/lib/features/camera/grd_camera_notifier.dart: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 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) flutter_app/lib/features/camera/camera_notifier.dart:1272— flutter_app/lib/features/camera/camera_notifier.dart:1272-1276 | flutter_app/lib/features/camera/grd_camera_notifier.dart:269-273 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) flutter_app/lib/features/camera/camera_notifier.dart:2113— flutter_app/lib/features/camera/camera_notifier.dart:2113-2117 | flutter_app/lib/models/camera_definition.dart:824-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `flutter_app/lib/features/camera/camera_notifier.dart:2111` calls `toDouble` and `flutter_app/lib/models/camera_definition.dart:822` 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) flutter_app/lib/services/camera_manager_service.dart:156— flutter_app/lib/services/camera_manager_service.dart:156-160 | flutter_app/lib/services/camera_manager_service.dart:170-174 — both copies are in the same file, so extract the 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) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1165— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1165-1169 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1261-1265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1165` it begins part-way through the construct above it, so those 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, `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1170` calls `d` and `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1266` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1151— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1151-1155 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1299-1303 — both copies are in the same file, so extract the 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, `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1297` calls `currentTimeMillis` and `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1147` 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) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2631— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2631-2635 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2686-2692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2631` it begins part-way through the construct above it, so those 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, `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2682` calls `recycle` and `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2627` 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) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2116— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2116-2120 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2187-2191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2116` it does not close everything it opens, so those exact lines 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) flutter_app/ios/Runner/Camera/CameraPlugin.swift:522— flutter_app/ios/Runner/Camera/CameraPlugin.swift:522-526 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:581-585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) flutter_app/ios/Runner/Camera/MetalRenderer.swift:648— flutter_app/ios/Runner/Camera/MetalRenderer.swift:648-652 | native_plugin/ios/Classes/MetalRenderer.swift:206-210 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Swallowed exception (caught, then discarded) native_plugin/android/src/main/kotlin/com/retrocam/app/models/Preset.kt:73— `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) flutter_app/lib/services/retain_settings_service.dart:178— `catch (_)` 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) flutter_app/lib/models/camera_definition.dart:172— `catch (_)` 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) flutter_app/lib/models/camera_definition.dart:181— `catch (_)` 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) flutter_app/lib/models/camera_definition.dart:190— `catch (_)` 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) flutter_app/lib/models/camera_definition.dart:199— `catch (_)` 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) flutter_app/lib/models/camera_definition.dart:208— `catch (_)` 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) flutter_app/lib/features/gallery/gallery_screen.dart:191— `catch (_)` 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) flutter_app/lib/features/camera/capture_pipeline.dart:381— `catch (_)` 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) flutter_app/lib/features/camera/capture_pipeline.dart:1903— `catch (_)` 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) flutter_app/lib/features/camera/capture_pipeline.dart:2074— `catch (_)` 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.
TooManyMethods: PreviewRenderParams flutter_app/lib/features/camera/preview_renderer.dart:148— TooManyMethods — 113 methods. The bar is 30 methods; this is 83 over it, 3.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: CameraAppNotifier flutter_app/lib/features/camera/camera_notifier.dart:414— TooManyMethods — 87 methods. The bar is 30 methods; this is 57 over it, 2.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CameraPlugin flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:74— 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: _CameraScreenState REDACTED:99— 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: RetroCamPlugin flutter_app/ios/Runner/Camera/CameraPlugin.swift:26— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CapturePipeline flutter_app/lib/features/camera/capture_pipeline.dart:33— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CameraService flutter_app/lib/services/camera_service.dart:131— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (14 lines × 2) flutter_app/lib/features/camera/camera_config_sheet.dart:224— flutter_app/lib/features/camera/camera_config_sheet.dart:224-237 | flutter_app/lib/features/camera/camera_config_sheet.dart:559-572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_config_sheet.dart: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.
Duplicated block (14 lines × 2) REDACTED:3639— REDACTED:3639-3652 | REDACTED:3654-3667 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3639` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) REDACTED:3701— REDACTED:3701-3714 | REDACTED:3748-3762 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3701` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) REDACTED:4482— REDACTED:4482-4495 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1635-1649 — `REDACTED` and `flutter_app/lib/features/image_edit/image_edit_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 221 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4482` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) flutter_app/ios/Runner/Camera/CameraSessionManager.swift:109— flutter_app/ios/Runner/Camera/CameraSessionManager.swift:109-122 | native_plugin/ios/Classes/Managers/CameraSessionManager.swift:73-86 — 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 `flutter_app/ios/Runner/Camera/CameraSessionManager.swift:109` it does not close everything it opens, so those 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, `flutter_app/ios/Runner/Camera/CameraSessionManager.swift:123` calls `applyMirroringLocked` and `native_plugin/ios/Classes/Managers/CameraSessionManager.swift:87` 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 (14 lines × 2) tools/generate_luts.py:66— tools/generate_luts.py:66-79 | tools/generate_luts.py:135-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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 2) flutter_app/lib/features/camera/camera_config_sheet.dart:1382— flutter_app/lib/features/camera/camera_config_sheet.dart:1382-1392 | flutter_app/lib/features/camera/camera_config_sheet.dart:1430-1440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_config_sheet.dart:1382` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) REDACTED:3406— REDACTED:3406-3416 | REDACTED:3526-3536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3406` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) REDACTED:3882— REDACTED:3882-3892 | flutter_app/lib/features/gallery/gallery_screen.dart:480-491 — `REDACTED` and `flutter_app/lib/features/gallery/gallery_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `flutter_app/lib/features/gallery/gallery_screen.dart:476` calls `setState` and `REDACTED:3880` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) REDACTED:3998— REDACTED:3998-4008 | flutter_app/lib/features/gallery/gallery_screen.dart:707-717 — `REDACTED` and `flutter_app/lib/features/gallery/gallery_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3998` it does not close everything it opens, so those exact lines 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) flutter_app/lib/features/camera/capture_pipeline.dart:951— flutter_app/lib/features/camera/capture_pipeline.dart:951-961 | flutter_app/lib/features/camera/capture_pipeline.dart:1111-1121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/capture_pipeline.dart:951` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:828— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:828-838 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:3020-3030 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:828` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Sync-over-async blocking flutter_app/lib/features/camera/camera_notifier.dart:1321— `takePhoto` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
Sync-over-async blocking flutter_app/lib/features/camera/camera_notifier.dart:1857— `_runBackgroundEnhanceAndReplace` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
Sync-over-async blocking flutter_app/lib/features/camera/capture_pipeline.dart:124— `process` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
Sync-over-async blocking flutter_app/lib/features/camera/capture_pipeline.dart:2086— `blendDoubleExposure` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
Sync-over-async blocking flutter_app/lib/features/image_edit/image_edit_screen.dart:255— `_save` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
Repeated repair: flutter_app/lib/features/camera/grd_camera_notifier.dart flutter_app/lib/features/camera/grd_camera_notifier.dart:282— flutter_app/lib/features/camera/grd_camera_notifier.dart changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is GrdCameraNotifier.takePhoto at line 282), 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(camera): restore preview pipeline and landscape ratio crop”; “fix: watermark default none + grd_camera reads watermark from cameraAppProvider”; “fix(ci): 修复 Flutter CI 编译错误”; “fix(ci): 修复 GitHub Actions 编译失败”. 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/lib/features/camera/grd_camera_notifier.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: flutter_app/lib/models/preset.dart flutter_app/lib/models/preset.dart:366— flutter_app/lib/models/preset.dart changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is Preset.fromJson at line 366), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(crash): tolerate numeric strings in settings and JSON parsing”; “fix: 修复 CI analyze 警告 + 优化代码质量”; “fix: resolve Android build errors and Dart compilation issues”. 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/lib/models/preset.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: flutter_app/ios/Runner/AppDelegate.swift flutter_app/ios/Runner/AppDelegate.swift:6— flutter_app/ios/Runner/AppDelegate.swift 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 2 (its worst body is AppDelegate.application at line 6), 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: restore iOS plugin registration and add missing Flutter import in CameraPlugin”; “fix: resolve Android Kotlin visibility error and optimize iOS plugin registration”; “fix: camera preview black screen + iOS plugin integration”. 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/ios/Runner/AppDelegate.swift`: 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: flutter_app/lib/services/subscription_service.dart flutter_app/lib/services/subscription_service.dart:26— flutter_app/lib/services/subscription_service.dart 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 4 (its worst body is SubscriptionService._initPlatformState at line 26), 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: 修复 CI analyze 警告 + 优化代码质量”; “fix: upgrade purchases_flutter to 9.x, add iOS project files, fix compileSdk=36, upgrade AGP to 8.3.0”; “fix: resolve Android build errors and Dart compilation issues”. 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 2025-12-24..2026-03-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-12-24 01:18:57 +08:00' --until='2026-03-24 01:18:57 +08:00' --full-history --no-merges -- flutter_app/lib/services/subscription_service.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (13 lines × 2) flutter_app/lib/features/camera/camera_config_sheet.dart:352— flutter_app/lib/features/camera/camera_config_sheet.dart:352-364 | flutter_app/lib/features/settings/settings_screen.dart:542-554 — 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 `flutter_app/lib/features/camera/camera_config_sheet.dart:352` it does not close everything it opens, so those 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, `flutter_app/lib/features/settings/settings_screen.dart:541` calls `SafeArea` and `flutter_app/lib/features/camera/camera_config_sheet.dart:351` 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) flutter_app/lib/features/camera/camera_sample_screen.dart:168— flutter_app/lib/features/camera/camera_sample_screen.dart:168-180 | flutter_app/lib/features/camera/camera_sample_screen.dart:199-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_sample_screen.dart:168` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) REDACTED:1714— REDACTED:1714-1726 | flutter_app/lib/features/image_edit/image_edit_screen.dart:583-595 — `REDACTED` and `flutter_app/lib/features/image_edit/image_edit_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 221 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1135— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1135-1147 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1282-1294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1135` it begins part-way through the construct above it, so those 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, `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1297` calls `currentTimeMillis` and `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1150` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) flutter_app/lib/features/camera/camera_controls_widget.dart:107— flutter_app/lib/features/camera/camera_controls_widget.dart:107-116 | flutter_app/lib/features/camera/camera_options_widget.dart:34-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `flutter_app/lib/features/camera/camera_controls_widget.dart:107` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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) REDACTED:2143— REDACTED:2143-2152 | REDACTED:2186-2195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2143` it begins part-way through the construct above it, so those exact lines 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) REDACTED:3145— REDACTED:3145-3155 | flutter_app/lib/features/settings/settings_screen.dart:128-137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3145` it does not close everything it opens, so those 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) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2147— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2147-2156 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2242-2251 — both copies are in the same file, so extract the 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, `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2253` calls `putAll` and `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2158` 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) flutter_app/lib/features/camera/camera_config_sheet.dart:1500— flutter_app/lib/features/camera/camera_config_sheet.dart:1500-1508 | flutter_app/lib/features/camera/camera_config_sheet.dart:1559-1567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_config_sheet.dart:1500` it does not close everything it opens, so those exact lines 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) flutter_app/lib/features/image_edit/image_edit_screen.dart:328— flutter_app/lib/features/image_edit/image_edit_screen.dart:328-336 | flutter_app/lib/features/image_edit/image_edit_screen.dart:361-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/image_edit/image_edit_screen.dart:328` it begins part-way through the construct above it, so those exact lines 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) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1044— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1044-1052 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1204-1212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1044` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1053` calls `d` and `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1213` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:774— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:774-782 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2965-2973 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:774` it does not close everything it opens, so those exact lines 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) REDACTED:5938— REDACTED:5938-5946 | flutter_app/lib/features/camera/capture_pipeline.dart:1915-1922 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) flutter_app/lib/features/camera/capture_pipeline.dart:697— flutter_app/lib/features/camera/capture_pipeline.dart:697-704 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1907-1914 — 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) flutter_app/ios/Runner/Camera/CameraPlugin.swift:783— flutter_app/ios/Runner/Camera/CameraPlugin.swift:783-790 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:1253-1261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/ios/Runner/Camera/CameraPlugin.swift:783` it begins part-way through the construct above it, so those 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, `flutter_app/ios/Runner/Camera/CameraPlugin.swift:782` calls `cleanup` and `flutter_app/ios/Runner/Camera/CameraPlugin.swift:1252` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1677— flutter_app/ios/Runner/Camera/CameraPlugin.swift:1677-1684 | flutter_app/ios/Runner/Camera/CaptureProcessor.swift:167-174 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (6 lines × 2) flutter_app/lib/features/camera/camera_config_sheet.dart:1440— flutter_app/lib/features/camera/camera_config_sheet.dart:1440-1445 | flutter_app/lib/features/camera/camera_config_sheet.dart:1447-1452 — both copies are in the same file, so extract the 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 (6 lines × 2) generate_shutter_sounds.py:144— generate_shutter_sounds.py:144-149 | generate_shutter_sounds.py:171-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) flutter_app/ios/Runner/Camera/CameraPlugin.swift:298— flutter_app/ios/Runner/Camera/CameraPlugin.swift:298-303 | native_plugin/ios/Classes/RetroCamPlugin.swift:62-67 — 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 `flutter_app/ios/Runner/Camera/CameraPlugin.swift:298` it does not close everything it opens, so those exact lines 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) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1487— flutter_app/ios/Runner/Camera/CameraPlugin.swift:1487-1492 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:1493-1498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Low cohesion: CameraAppNotifier (LCOM4 24) flutter_app/lib/features/camera/camera_notifier.dart:414— CameraAppNotifier's methods fall into 24 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 24 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: GrdCameraNotifier (LCOM4 13) flutter_app/lib/features/camera/grd_camera_notifier.dart:165— GrdCameraNotifier's methods fall into 13 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 13 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: _CameraScreenState (LCOM4 4) REDACTED:99— _CameraScreenState'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: PreviewRenderParams (LCOM4 4) flutter_app/lib/features/camera/preview_renderer.dart:148— PreviewRenderParams's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Change coupling: CameraPlugin.kt ↔ CameraSessionManager.swift flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1— `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt` and `flutter_app/ios/Runner/Camera/CameraSessionManager.swift` change together 73% of the time (11 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `9ef00366` Fix camera stop-preview race on navigation; `f963870e` Finalize camera and gallery fixes; `b2ca2a40` Add system live photo capture flow — run `git show` on any of them.
Change coupling: CameraGLRenderer.kt ↔ MetalRenderer.swift flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt:1— `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt` and `flutter_app/ios/Runner/Camera/MetalRenderer.swift` change together 71% of the time (20 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `32dadbc2` Restore lightweight preview effects; `9558ba29` Sync camera pipeline updates; `490589a7` Fix preview LUT recovery on startup — run `git show` on any of them.
Change coupling: CaptureGLProcessor.kt ↔ CaptureProcessor.swift flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1— `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt` and `flutter_app/ios/Runner/Camera/CaptureProcessor.swift` change together 71% of the time (10 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `a4d481c7` Implement JSON-driven filmic tone mapping and mid-gray control; `fb7d1bf1` feat(color-v3): wire device calibration in native preview and capture…; `a0d9ae09` fix(camera): stabilize save pipeline, orientation, and fisheye rendering — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×3
Edited copy of a member (9 corresponding lines) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1676— flutter_app/ios/Runner/Camera/CameraPlugin.swift:1676-1684 | flutter_app/ios/Runner/Camera/CaptureProcessor.swift:166-174 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) REDACTED:5030— REDACTED:5030-5038 | REDACTED:5040-5048 — 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) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1614— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1614-1622 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1624-1632 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×3
Edited copy of a member (12 corresponding lines) flutter_app/lib/features/gallery/gallery_screen.dart:1474— flutter_app/lib/features/gallery/gallery_screen.dart:1474-1486 | flutter_app/lib/features/gallery/gallery_screen.dart:1488-1499 — 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) flutter_app/lib/features/camera/camera_config_sheet.dart:2452— flutter_app/lib/features/camera/camera_config_sheet.dart:2452-2463 | REDACTED:4899-4910 — 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) flutter_app/lib/features/camera/camera_controls_widget.dart:104— flutter_app/lib/features/camera/camera_controls_widget.dart:104-116 | flutter_app/lib/features/subscription/subscription_screen.dart:149-160 — 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.
Duplicated block (23 lines × 2) flutter_app/lib/features/camera/camera_config_sheet.dart:1212— flutter_app/lib/features/camera/camera_config_sheet.dart:1212-1234 | flutter_app/lib/features/camera/camera_config_sheet.dart:1256-1278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_config_sheet.dart:1212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) REDACTED:4290— REDACTED:4290-4312 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1428-1450 — `REDACTED` and `flutter_app/lib/features/image_edit/image_edit_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 221 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4290` it does not close everything it opens, so those exact lines 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) flutter_app/ios/Runner/Camera/CameraSessionManager.swift:45— flutter_app/ios/Runner/Camera/CameraSessionManager.swift:45-67 | native_plugin/ios/Classes/Managers/CameraSessionManager.swift:28-50 — 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) flutter_app/lib/features/camera/camera_config_sheet.dart:124— flutter_app/lib/features/camera/camera_config_sheet.dart:124-138 | flutter_app/lib/features/camera/camera_config_sheet.dart:445-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 `flutter_app/lib/features/camera/camera_config_sheet.dart:124` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) REDACTED:5410— REDACTED:5410-5424 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1243-1257 — `REDACTED` and `flutter_app/lib/features/image_edit/image_edit_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 221 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) flutter_app/lib/features/camera/preview_renderer.dart:638— flutter_app/lib/features/camera/preview_renderer.dart:638-652 | flutter_app/lib/features/camera/preview_renderer.dart:672-686 — both copies are in the same file, so extract the 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.
Cross-slice coupling: settings → camera flutter_app/lib/features/settings/settings_screen.dart:730— `_RenderModeSegment` (slice 'settings') depends on `RenderStyleMode` from slice 'camera'.
Cross-slice coupling: settings → camera flutter_app/lib/features/settings/settings_screen.dart:770— `_PreviewModeSegment` (slice 'settings') depends on `PreviewPerformanceMode` from slice 'camera'.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (4 members, 50+ identical tokens) flutter_app/lib/features/camera/camera_config_sheet.dart:102— flutter_app/lib/features/camera/camera_config_sheet.dart:102-145 | flutter_app/lib/features/camera/camera_config_sheet.dart:419-474 | flutter_app/lib/features/camera/camera_config_sheet.dart:1646-1676 | flutter_app/lib/features/camera/camera_config_sheet.dart:1679-1701 — 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) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt:930— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt:930-1071 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt:1610-1655 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1722-1777 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1779-1790 — 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 (66 corresponding lines) · ×2
Edited copy of a member (66 corresponding lines) fix_luts_v2.py:26— fix_luts_v2.py:26-91 | generate_camera_luts.py:27-110 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (66 corresponding lines) REDACTED:4445— REDACTED:4445-4510 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1597-1664 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×2
Edited copy of a member (14 corresponding lines) REDACTED:4879— REDACTED:4879-4892 | flutter_app/lib/features/camera/preview_renderer.dart:1307-1336 — 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) flutter_app/ios/Runner/Camera/CameraSessionManager.swift:155— flutter_app/ios/Runner/Camera/CameraSessionManager.swift:155-168 | flutter_app/ios/Runner/Camera/CameraSessionManager.swift:174-188 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×2
Edited copy of a member (23 corresponding lines) fix_luts_v2.py:95— fix_luts_v2.py:95-117 | generate_camera_luts.py:114-143 — 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) generate_shutter_sounds.py:71— generate_shutter_sounds.py:71-97 | generate_shutter_sounds.py:163-185 — 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 (13 corresponding lines) · ×2
Edited copy of a member (13 corresponding lines) flutter_app/lib/services/camera_manager_service.dart:115— flutter_app/lib/services/camera_manager_service.dart:115-127 | flutter_app/lib/services/camera_manager_service.dart:130-144 — 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) flutter_app/lib/features/subscription/subscription_screen.dart:34— flutter_app/lib/features/subscription/subscription_screen.dart:34-46 | flutter_app/lib/features/subscription/subscription_screen.dart:48-64 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×2
Edited copies of one member (3 members, 9+ corresponding lines) flutter_app/lib/models/camera_definition.dart:1318— flutter_app/lib/models/camera_definition.dart:1318-1326 | flutter_app/lib/models/preset.dart:167-176 | flutter_app/lib/models/preset.dart:259-267 — 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) flutter_app/ios/Runner/Camera/CameraPlugin.swift:355— flutter_app/ios/Runner/Camera/CameraPlugin.swift:355-363 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:368-376 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:382-391 — 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.
Duplicated block (33–35 lines × 2) flutter_app/lib/features/settings/settings_screen.dart:221— flutter_app/lib/features/settings/settings_screen.dart:221-255 | flutter_app/lib/features/settings/settings_screen.dart:820-852 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/settings/settings_screen.dart:221` it does not close everything it opens, so those 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, `flutter_app/lib/features/settings/settings_screen.dart:219` calls `watch` and `flutter_app/lib/features/settings/settings_screen.dart:818` 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 (33–35 lines × 2) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1098— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1098-1132 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1248-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. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1098` it does not close everything it opens, so those exact lines 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) REDACTED:5182— REDACTED:5182-5210 | REDACTED:5511-5539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:5182` it does not close everything it opens, so those exact lines 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) flutter_app/lib/features/camera/capture_pipeline.dart:1312— flutter_app/lib/features/camera/capture_pipeline.dart:1312-1340 | flutter_app/lib/features/camera/capture_pipeline.dart:1477-1505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/capture_pipeline.dart:1477` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) REDACTED:3393— REDACTED:3393-3410 | REDACTED:3606-3623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3393` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) flutter_app/ios/Runner/Camera/CameraPlugin.swift:503— flutter_app/ios/Runner/Camera/CameraPlugin.swift:503-520 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:561-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `flutter_app/ios/Runner/Camera/CameraPlugin.swift:579` calls `merge` and `flutter_app/ios/Runner/Camera/CameraPlugin.swift:521` 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) REDACTED:4585— REDACTED:4585-4600 | REDACTED:4653-4668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4585` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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) flutter_app/ios/Runner/Camera/CameraPlugin.swift:949— flutter_app/ios/Runner/Camera/CameraPlugin.swift:949-964 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:1007-1022 — both copies are in the same file, so extract the 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 (10–11 lines × 2) REDACTED:2218— REDACTED:2218-2227 | REDACTED:3409-3419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2218` it does not close everything it opens, so those exact lines 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) flutter_app/lib/services/camera_service.dart:683— flutter_app/lib/services/camera_service.dart:683-692 | flutter_app/lib/services/camera_service.dart:732-742 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/services/camera_service.dart:683` it begins part-way through the construct above it, so those exact lines 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) flutter_app/lib/features/camera/camera_config_sheet.dart:153— flutter_app/lib/features/camera/camera_config_sheet.dart:153-161 | flutter_app/lib/features/camera/camera_config_sheet.dart:481-490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_config_sheet.dart:153` it does not close everything it opens, so those exact lines 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) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1133— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1133-1141 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1231-1240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1142` calls `d` and `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1241` 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) flutter_app/lib/features/camera/camera_notifier.dart:1264— flutter_app/lib/features/camera/camera_notifier.dart:1264-1270 | flutter_app/lib/features/camera/grd_camera_notifier.dart:261-267 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) REDACTED:3901— REDACTED:3901-3907 | flutter_app/lib/features/gallery/gallery_screen.dart:493-499 — `REDACTED` and `flutter_app/lib/features/gallery/gallery_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3901` it does not close everything it opens, so those exact lines 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) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2132— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2132-2145 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2217-2229 — both copies are in the same file, so extract the 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) flutter_app/ios/Runner/Camera/CameraPlugin.swift:729— flutter_app/ios/Runner/Camera/CameraPlugin.swift:729-741 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:1198-1211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) flutter_app/ios/WidgetsExtension/DazzCameraWidgetsBundle.swift:86— flutter_app/ios/WidgetsExtension/DazzCameraWidgetsBundle.swift:86-97 | flutter_app/ios/WidgetsExtension/DazzCameraWidgetsBundle.swift:112-123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/ios/WidgetsExtension/DazzCameraWidgetsBundle.swift:86` it does not close everything it opens, so those exact lines 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) flutter_app/ios/Runner/Camera/CameraPlugin.swift:490— flutter_app/ios/Runner/Camera/CameraPlugin.swift:490-501 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:537-548 — both copies are in the same file, so extract the 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.
CapturePipeline.process (cyclomatic 183) flutter_app/lib/features/camera/capture_pipeline.dart:124— CapturePipeline.process has cyclomatic complexity 183 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RetroCamPlugin.buildShaderParams (cyclomatic 94) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1763— RetroCamPlugin.buildShaderParams has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CameraAppNotifier.takePhoto (cyclomatic 88) flutter_app/lib/features/camera/camera_notifier.dart:1321— CameraAppNotifier.takePhoto 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.
MetalRenderer.updateParams (cyclomatic 87) flutter_app/ios/Runner/Camera/MetalRenderer.swift:283— MetalRenderer.updateParams has cyclomatic complexity 87 (threshold 15). Of this number, 78 points are the body's own statements and 9 belong to 2 function items 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.
DefaultLook.toJson (cyclomatic 58) flutter_app/lib/models/camera_definition.dart:569— DefaultLook.toJson has cyclomatic complexity 58 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_CameraScreenState._classifySceneHintKey (cyclomatic 43) REDACTED:807— _CameraScreenState._classifySceneHintKey has cyclomatic complexity 43 (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.
PreviewRenderParams.sceneClass (cyclomatic 42) flutter_app/lib/features/camera/preview_renderer.dart:243— PreviewRenderParams.sceneClass has cyclomatic complexity 42 (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.
MetalRenderer.updateParams (cyclomatic 35) native_plugin/ios/Classes/MetalRenderer.swift:94— MetalRenderer.updateParams 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.
_SubPanelState._buildWatermarkContent (cyclomatic 32) flutter_app/lib/features/camera/camera_config_sheet.dart:980— _SubPanelState._buildWatermarkContent 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.
_ImageEditScreenState._save (cyclomatic 32) flutter_app/lib/features/image_edit/image_edit_screen.dart:255— _ImageEditScreenState._save 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.
_CameraScreenState._buildViewfinderArea (cyclomatic 31) REDACTED:1772— _CameraScreenState._buildViewfinderArea 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.
_CameraScreenState.build (cyclomatic 29) REDACTED:1382— _CameraScreenState.build 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.
CaptureGLProcessor.setUniforms (cyclomatic 25) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1561— CaptureGLProcessor.setUniforms 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.
CapturePipeline._drawWatermark (cyclomatic 24) flutter_app/lib/features/camera/capture_pipeline.dart:1883— CapturePipeline._drawWatermark 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.
CameraPlugin.buildMotionPhotoVideoEffects (cyclomatic 24) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1445— CameraPlugin.buildMotionPhotoVideoEffects has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: CameraPlugin.onMethodCall (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.
RetroCamPlugin.handleComposeOverlay (cyclomatic 24) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1346— RetroCamPlugin.handleComposeOverlay has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: RetroCamPlugin.handle (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
_CameraScreenState._buildTopMenuOverlay (cyclomatic 23) REDACTED:2946— _CameraScreenState._buildTopMenuOverlay 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.
_LivePhotoSupport._resolvePlaybackPath (cyclomatic 23) flutter_app/lib/features/gallery/gallery_screen.dart:206— _LivePhotoSupport._resolvePlaybackPath 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.
_PhotoDetailPageState.build (cyclomatic 23) flutter_app/lib/features/gallery/gallery_screen.dart:1570— _PhotoDetailPageState.build 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.
_WatermarkPainter.paint (cyclomatic 22) REDACTED:5928— _WatermarkPainter.paint 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.
_FrameOverlayPainter.paint (cyclomatic 22) flutter_app/lib/features/image_edit/image_edit_screen.dart:1984— _FrameOverlayPainter.paint 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.
RetroCamPlugin.handleSaveLivePhoto (cyclomatic 21) flutter_app/ios/Runner/Camera/CameraPlugin.swift:703— RetroCamPlugin.handleSaveLivePhoto 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: RetroCamPlugin.handle (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
CameraAppNotifier._loadCamera (cyclomatic 20) flutter_app/lib/features/camera/camera_notifier.dart:672— CameraAppNotifier._loadCamera 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.
_CameraScreenState._doTakePhoto (cyclomatic 20) REDACTED:1297— _CameraScreenState._doTakePhoto 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.
_CameraScreenState._buildControlCapsule (cyclomatic 20) REDACTED:2381— _CameraScreenState._buildControlCapsule 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.
CapturePipeline.buildColorMatrix (cyclomatic 20) flutter_app/lib/features/camera/capture_pipeline.dart:1139— CapturePipeline.buildColorMatrix 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.
_GalleryScreenState._fetchAssets (cyclomatic 20) flutter_app/lib/features/gallery/gallery_screen.dart:427— _GalleryScreenState._fetchAssets 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.
RetroCamPlugin.reapplyRuntimeStateToRenderer (cyclomatic 20) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1709— RetroCamPlugin.reapplyRuntimeStateToRenderer has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: RetroCamPlugin.handle (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
CaptureProcessor.processImage (cyclomatic 20) flutter_app/ios/Runner/Camera/CaptureProcessor.swift:183— CaptureProcessor.processImage 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.
_SubPanelState.build (cyclomatic 19) flutter_app/lib/features/camera/camera_config_sheet.dart:698— _SubPanelState.build 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.
RetroCamPlugin.handleSaveToGallery (cyclomatic 19) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1171— RetroCamPlugin.handleSaveToGallery 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. This is NOT this file's highest cyclomatic complexity: RetroCamPlugin.handle (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
MetalRenderer.loadLutTexture (cyclomatic 19) flutter_app/ios/Runner/Camera/MetalRenderer.swift:503— MetalRenderer.loadLutTexture 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.
CameraService._onNativeEvent (cyclomatic 18) flutter_app/lib/services/camera_service.dart:787— CameraService._onNativeEvent 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.
CaptureProcessor.loadLutTexture (cyclomatic 18) flutter_app/ios/Runner/Camera/CaptureProcessor.swift:493— CaptureProcessor.loadLutTexture 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.
_CameraScreenState._scheduleSceneHintRefresh (cyclomatic 17) REDACTED:711— _CameraScreenState._scheduleSceneHintRefresh 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.
CapturePipeline._readJpegDimensions (cyclomatic 17) flutter_app/lib/features/camera/capture_pipeline.dart:2045— CapturePipeline._readJpegDimensions 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.
_ImageEditScreenState._buildEditControlCapsule (cyclomatic 17) flutter_app/lib/features/image_edit/image_edit_screen.dart:758— _ImageEditScreenState._buildEditControlCapsule 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.
MetalRenderer.captureOutput (cyclomatic 17) native_plugin/ios/Classes/MetalRenderer.swift:167— MetalRenderer.captureOutput 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.
RetroCamPlugin.prepareLivePhotoVideoForSaving (cyclomatic 17) flutter_app/ios/Runner/Camera/CameraPlugin.swift:836— RetroCamPlugin.prepareLivePhotoVideoForSaving 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: RetroCamPlugin.handle (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RetroCamPlugin.applyLivePhotoFilters (cyclomatic 17) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1086— RetroCamPlugin.applyLivePhotoFilters has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: RetroCamPlugin.handle (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
MetalRenderer.renderFrame (cyclomatic 17) flutter_app/ios/Runner/Camera/MetalRenderer.swift:606— MetalRenderer.renderFrame 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.
_CameraScreenState._ensurePreviewHealthWatchdog (cyclomatic 16) REDACTED:871— _CameraScreenState._ensurePreviewHealthWatchdog 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.
_ImageEditScreenState._buildPreviewArea (cyclomatic 16) flutter_app/lib/features/image_edit/image_edit_screen.dart:574— _ImageEditScreenState._buildPreviewArea 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.
CameraSessionManager.setWhiteBalance (cyclomatic 16) flutter_app/ios/Runner/Camera/CameraSessionManager.swift:237— CameraSessionManager.setWhiteBalance 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.
TodoComment flutter_app/lib/services/subscription_service.dart:11— // TODO: 上线前改回 SubscriptionService() — 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.
CapturePipeline.process (cognitive 355) flutter_app/lib/features/camera/capture_pipeline.dart:124— CapturePipeline.process has cognitive complexity 355 (threshold 15). Drivers by points: if/else 68 (174 pts), boolean chains 83, error handling 13 (45 pts), ternaries 18 (45 pts), match/switch 2 (8 pts) (nesting depth added 171). 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.
CameraAppNotifier.takePhoto (cognitive 243) flutter_app/lib/features/camera/camera_notifier.dart:1321— CameraAppNotifier.takePhoto has cognitive complexity 243 (threshold 15). Drivers by points: if/else 45 (155 pts), error handling 8 (39 pts), boolean chains 35, match/switch 2 (10 pts), ternaries 1 (4 pts) (nesting depth added 152). 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.
RetroCamPlugin.buildShaderParams (cognitive 187) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1763— RetroCamPlugin.buildShaderParams has cognitive complexity 187 (threshold 15). Drivers by points: if/else 91 (183 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 94). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetalRenderer.updateParams (cognitive 105) flutter_app/ios/Runner/Camera/MetalRenderer.swift:283— MetalRenderer.updateParams has cognitive complexity 105 (threshold 15). Drivers by points: if/else 83 (96 pts), ternaries 2 (5 pts), boolean chains 4 (nesting depth added 16). Of this number, 96 points are the body's own statements and 9 belong to 2 function items 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_ImageEditScreenState._save (cognitive 64) flutter_app/lib/features/image_edit/image_edit_screen.dart:255— _ImageEditScreenState._save has cognitive complexity 64 (threshold 15). Drivers by points: if/else 17 (41 pts), error handling 5 (13 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DefaultLook.toJson (cognitive 57) flutter_app/lib/models/camera_definition.dart:569— DefaultLook.toJson has cognitive complexity 57 (threshold 15). Drivers by points: if/else 56, 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.
_SubPanelState._buildWatermarkContent (cognitive 54) flutter_app/lib/features/camera/camera_config_sheet.dart:980— _SubPanelState._buildWatermarkContent has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 22 (44 pts), if/else 6 (7 pts), boolean chains 3 (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.
_CameraScreenState._classifySceneHintKey (cognitive 49) REDACTED:807— _CameraScreenState._classifySceneHintKey has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 28, if/else 14 (20 pts), ternaries 1 (nesting depth added 6). 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.
PreviewRenderParams.sceneClass (cognitive 46) flutter_app/lib/features/camera/preview_renderer.dart:243— PreviewRenderParams.sceneClass has cognitive complexity 46 (threshold 15). Drivers by points: boolean chains 29, if/else 12 (17 pts) (nesting depth added 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.
_CameraScreenState._buildViewfinderArea (cognitive 38) REDACTED:1772— _CameraScreenState._buildViewfinderArea has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (27 pts), ternaries 4 (7 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
MetalRenderer.updateParams (cognitive 38) native_plugin/ios/Classes/MetalRenderer.swift:94— MetalRenderer.updateParams has cognitive complexity 38 (threshold 15). Drivers by points: if/else 35 (38 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.
_FrameOverlayPainter.paint (cognitive 37) flutter_app/lib/features/image_edit/image_edit_screen.dart:1984— _FrameOverlayPainter.paint has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 4 (8 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.
CameraPlugin.buildMotionPhotoVideoEffects (cognitive 37) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1445— CameraPlugin.buildMotionPhotoVideoEffects has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (35 pts), boolean chains 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.
_CameraScreenState.build (cognitive 35) REDACTED:1382— _CameraScreenState.build has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 10 (14 pts), boolean chains 6 (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.
_LivePhotoSupport._resolvePlaybackPath (cognitive 35) flutter_app/lib/features/gallery/gallery_screen.dart:206— _LivePhotoSupport._resolvePlaybackPath has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 8 (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.
_GalleryScreenState._fetchAssets (cognitive 34) flutter_app/lib/features/gallery/gallery_screen.dart:427— _GalleryScreenState._fetchAssets has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 5, loops 1 (2 pts), error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CaptureGLProcessor.setUniforms (cognitive 34) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1561— CaptureGLProcessor.setUniforms has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (25 pts), loops 3 (6 pts), match/switch 2, 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.
_PhotoDetailPageState.build (cognitive 33) flutter_app/lib/features/gallery/gallery_screen.dart:1570— _PhotoDetailPageState.build has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 7 (13 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.
RetroCamPlugin.reapplyRuntimeStateToRenderer (cognitive 31) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1709— RetroCamPlugin.reapplyRuntimeStateToRenderer has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (27 pts), ternaries 1 (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.
CameraAppNotifier._loadCamera (cognitive 30) flutter_app/lib/features/camera/camera_notifier.dart:672— CameraAppNotifier._loadCamera has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 5 (10 pts), boolean chains 9, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RetroCamPlugin.handleSetPreset (cognitive 30) native_plugin/ios/Classes/RetroCamPlugin.swift:62— RetroCamPlugin.handleSetPreset has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_SubPanelState.build (cognitive 29) flutter_app/lib/features/camera/camera_config_sheet.dart:698— _SubPanelState.build has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 4 (7 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CameraScreenState._doTakePhoto (cognitive 29) REDACTED:1297— _CameraScreenState._doTakePhoto has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 7 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CapturePipeline._readJpegDimensions (cognitive 28) flutter_app/lib/features/camera/capture_pipeline.dart:2045— CapturePipeline._readJpegDimensions has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 8, loops 1 (2 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RetroCamPlugin.handleComposeOverlay (cognitive 28) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1346— RetroCamPlugin.handleComposeOverlay has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 8, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CaptureProcessor.processImage (cognitive 28) flutter_app/ios/Runner/Camera/CaptureProcessor.swift:183— CaptureProcessor.processImage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 2, 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.
CameraSessionManager.setWhiteBalance (cognitive 27) flutter_app/ios/Runner/Camera/CameraSessionManager.swift:237— CameraSessionManager.setWhiteBalance has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RetroCamPlugin.handleSaveToGallery (cognitive 26) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1171— RetroCamPlugin.handleSaveToGallery 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.
CameraPlugin.handleSetSharpen (cognitive 24) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1872— CameraPlugin.handleSetSharpen has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 4 (9 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetalRenderer.loadLutTexture (cognitive 24) flutter_app/ios/Runner/Camera/MetalRenderer.swift:503— MetalRenderer.loadLutTexture has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6, 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.
RetroCamPlugin.handleSaveLivePhoto (cognitive 23) flutter_app/ios/Runner/Camera/CameraPlugin.swift:703— RetroCamPlugin.handleSaveLivePhoto has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 6, ternaries 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.
CaptureProcessor.loadLutTexture (cognitive 23) flutter_app/ios/Runner/Camera/CaptureProcessor.swift:493— CaptureProcessor.loadLutTexture has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, 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.
CameraPlugin.bindCameraUseCases (cognitive 22) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:356— CameraPlugin.bindCameraUseCases has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 2 (5 pts), boolean chains 1, 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.
CameraAppNotifier._runBackgroundEnhanceAndReplace (cognitive 21) flutter_app/lib/features/camera/camera_notifier.dart:1857— CameraAppNotifier._runBackgroundEnhanceAndReplace has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 3 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CapturePipeline.buildColorMatrix (cognitive 21) flutter_app/lib/features/camera/capture_pipeline.dart:1139— CapturePipeline.buildColorMatrix has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
_PhotoDetailPageState._ensureLiveVideoReady (cognitive 21) flutter_app/lib/features/gallery/gallery_screen.dart:1435— _PhotoDetailPageState._ensureLiveVideoReady has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CameraService._onNativeEvent (cognitive 21) flutter_app/lib/services/camera_service.dart:787— CameraService._onNativeEvent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 2 (4 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.
CameraPlugin.drawWatermarkOnCanvas (cognitive 21) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2730— CameraPlugin.drawWatermarkOnCanvas has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RetroCamPlugin.resolveFlutterAssetPath (cognitive 21) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1617— RetroCamPlugin.resolveFlutterAssetPath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, 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.
_CameraScreenState._buildTopMenuOverlay (cognitive 20) REDACTED:2946— _CameraScreenState._buildTopMenuOverlay has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 16, if/else 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.
_GallerySheetState._loadPhotos (cognitive 20) REDACTED:3866— _GallerySheetState._loadPhotos has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CameraScreenState._scheduleSceneHintRefresh (cognitive 19) REDACTED:711— _CameraScreenState._scheduleSceneHintRefresh has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10, if/else 6 (9 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.
_CameraScreenState._buildControlCapsule (cognitive 19) REDACTED:2381— _CameraScreenState._buildControlCapsule has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 12, boolean chains 5, if/else 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CameraService.syncCameraState (cognitive 19) flutter_app/lib/services/camera_service.dart:311— CameraService.syncCameraState has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 1 (2 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.
RetroCamPlugin.prepareLivePhotoVideoForSaving (cognitive 19) flutter_app/ios/Runner/Camera/CameraPlugin.swift:836— RetroCamPlugin.prepareLivePhotoVideoForSaving has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 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.
CameraConfigInlinePanel._buildFunctionRow (cognitive 18) flutter_app/lib/features/camera/camera_config_sheet.dart:148— CameraConfigInlinePanel._buildFunctionRow has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 5, if/else 5, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CameraScreenState._ensurePreviewHealthWatchdog (cognitive 18) REDACTED:871— _CameraScreenState._ensurePreviewHealthWatchdog has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_WatermarkPainter.paint (cognitive 18) REDACTED:5928— _WatermarkPainter.paint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6, match/switch 3 (5 pts), error handling 1 (2 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CapturePipeline._drawWatermark (cognitive 18) flutter_app/lib/features/camera/capture_pipeline.dart:1883— CapturePipeline._drawWatermark has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, match/switch 3 (5 pts), error handling 2 (3 pts), boolean chains 1, ternaries 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.
_ImageEditScreenState._initPreview (cognitive 18) flutter_app/lib/features/image_edit/image_edit_screen.dart:172— _ImageEditScreenState._initPreview has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CameraConfigSheetState._buildFunctionRow (cognitive 17) flutter_app/lib/features/camera/camera_config_sheet.dart:476— _CameraConfigSheetState._buildFunctionRow has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 5, boolean chains 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GrdCameraNotifier.takePhoto (cognitive 17) flutter_app/lib/features/camera/grd_camera_notifier.dart:282— GrdCameraNotifier.takePhoto has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 1 (4 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.
_RulerPainter.paint (cognitive 17) flutter_app/lib/features/image_edit/image_edit_screen.dart:1303— _RulerPainter.paint has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 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.
Preset.fromJson (cognitive 17) flutter_app/lib/models/preset.dart:366— Preset.fromJson has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5 (7 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CameraPlugin.handleComposeOverlay (cognitive 17) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2537— CameraPlugin.handleComposeOverlay has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CameraPlugin.reapplyPresetToRenderer (cognitive 17) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2955— CameraPlugin.reapplyPresetToRenderer 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.
MotionPhotoPackaging.extractApp1XmpPackets (cognitive 17) REDACTED:266— MotionPhotoPackaging.extractApp1XmpPackets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, match/switch 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CameraScreenState._startOrientationListener (cognitive 16) REDACTED:317— _CameraScreenState._startOrientationListener has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, ternaries 2 (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.
_ImageEditScreenState._buildPreviewArea (cognitive 16) flutter_app/lib/features/image_edit/image_edit_screen.dart:574— _ImageEditScreenState._buildPreviewArea has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 6, ternaries 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.
_ImageEditScreenState._buildEditControlCapsule (cognitive 16) flutter_app/lib/features/image_edit/image_edit_screen.dart:758— _ImageEditScreenState._buildEditControlCapsule has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9, boolean chains 5, if/else 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CameraPlugin.cachePresetAndBuildShaderParams (cognitive 16) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:754— CameraPlugin.cachePresetAndBuildShaderParams has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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.
MetalRenderer.captureOutput (cognitive 16) native_plugin/ios/Classes/MetalRenderer.swift:167— MetalRenderer.captureOutput 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.
RetroCamPlugin.applyLivePhotoFilters (cognitive 16) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1086— RetroCamPlugin.applyLivePhotoFilters has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 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.
MetalRenderer.renderFrame (cognitive 16) flutter_app/ios/Runner/Camera/MetalRenderer.swift:606— MetalRenderer.renderFrame 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.
Near-duplicate member pair (94 shared lines) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1028— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1028-1164 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1179-1310 — These two members are variants of one another: 94 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (52 shared lines) flutter_app/lib/features/camera/camera_config_sheet.dart:148— flutter_app/lib/features/camera/camera_config_sheet.dart:148-237 | flutter_app/lib/features/camera/camera_config_sheet.dart:476-572 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (50 shared lines) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:754— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:754-843 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2955-3069 — These two members are variants of one another: 50 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 (35 shared lines) flutter_app/ios/Runner/Camera/CameraPlugin.swift:488— flutter_app/ios/Runner/Camera/CameraPlugin.swift:488-532 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:534-594 — 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· Edited copy of a member (68 corresponding lines) · ×1
Edited copy of a member (68 corresponding lines) flutter_app/ios/Runner/Camera/CaptureProcessor.swift:493— flutter_app/ios/Runner/Camera/CaptureProcessor.swift:493-560 | flutter_app/ios/Runner/Camera/MetalRenderer.swift:503-584 — 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 (101 corresponding lines) · ×1
Edited copy of a member (101 corresponding lines) REDACTED:2211— REDACTED:2211-2311 | REDACTED:3387-3509 — These two members are one piece of code written twice and then edited apart: 101 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (80 corresponding lines) · ×1
Edited copy of a member (80 corresponding lines) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1109— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1109-1188 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1190-1289 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (87 corresponding lines) · ×1
Edited copy of a member (87 corresponding lines) REDACTED:5248— REDACTED:5248-5349 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1111-1197 — 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 (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) REDACTED:4366— REDACTED:4366-4425 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1509-1578 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) REDACTED:4290— REDACTED:4290-4350 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1428-1497 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (64 corresponding lines) · ×1
Edited copy of a member (64 corresponding lines) flutter_app/lib/features/camera/camera_config_sheet.dart:1930— flutter_app/lib/features/camera/camera_config_sheet.dart:1930-1999 | flutter_app/lib/features/camera/camera_config_sheet.dart:2608-2671 — 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 (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) flutter_app/lib/features/camera/camera_config_sheet.dart:872— flutter_app/lib/features/camera/camera_config_sheet.dart:872-909 | flutter_app/lib/features/camera/camera_config_sheet.dart:912-951 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) flutter_app/lib/features/camera/camera_config_sheet.dart:2518— flutter_app/lib/features/camera/camera_config_sheet.dart:2518-2588 | flutter_app/lib/features/camera/preset_selector_widget.dart:64-117 — 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 (48 corresponding lines) · ×1
Edited copy of a member (48 corresponding lines) REDACTED:4553— REDACTED:4553-4600 | REDACTED:4610-4668 — 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 (39 corresponding lines) · ×1
Edited copy of a member (39 corresponding lines) flutter_app/ios/Runner/Camera/CameraSessionManager.swift:33— flutter_app/ios/Runner/Camera/CameraSessionManager.swift:33-88 | native_plugin/ios/Classes/Managers/CameraSessionManager.swift:20-58 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) flutter_app/lib/features/camera/camera_manager_screen.dart:120— flutter_app/lib/features/camera/camera_manager_screen.dart:120-165 | flutter_app/lib/features/camera/camera_manager_screen.dart:178-227 — 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 (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) flutter_app/ios/Runner/Camera/CameraSessionManager.swift:343— flutter_app/ios/Runner/Camera/CameraSessionManager.swift:343-378 | flutter_app/ios/Runner/Camera/CameraSessionManager.swift:380-414 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1332— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1332-1351 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1808-1839 — 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 (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) REDACTED:5368— REDACTED:5368-5405 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1207-1239 — 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 copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) flutter_app/lib/features/settings/settings_screen.dart:742— flutter_app/lib/features/settings/settings_screen.dart:742-766 | flutter_app/lib/features/settings/settings_screen.dart:782-806 — 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 (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) flutter_app/lib/services/camera_service.dart:669— flutter_app/lib/services/camera_service.dart:669-692 | flutter_app/lib/services/camera_service.dart:721-742 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) flutter_app/ios/Runner/Camera/CameraSessionManager.swift:109— flutter_app/ios/Runner/Camera/CameraSessionManager.swift:109-126 | native_plugin/ios/Classes/Managers/CameraSessionManager.swift:73-89 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×1
Edited copy of a member (10 corresponding lines) flutter_app/ios/Runner/Camera/CameraPlugin.swift:65— flutter_app/ios/Runner/Camera/CameraPlugin.swift:65-81 | native_plugin/ios/Classes/RetroCamPlugin.swift:11-20 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) flutter_app/lib/features/camera/capture_pipeline.dart:1257— flutter_app/lib/features/camera/capture_pipeline.dart:1257-1283 | flutter_app/lib/features/camera/capture_pipeline.dart:1359-1385 — 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 (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) flutter_app/lib/features/camera/camera_config_sheet.dart:239— flutter_app/lib/features/camera/camera_config_sheet.dart:239-254 | flutter_app/lib/features/camera/camera_config_sheet.dart:576-596 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×1
Edited copies of one member (3 members, 14+ corresponding lines) flutter_app/lib/features/camera/preview_renderer.dart:787— flutter_app/lib/features/camera/preview_renderer.dart:787-801 | flutter_app/lib/features/camera/preview_renderer.dart:803-816 | flutter_app/lib/features/camera/preview_renderer.dart:818-831 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) flutter_app/lib/features/camera/capture_pipeline.dart:1387— flutter_app/lib/features/camera/capture_pipeline.dart:1387-1412 | flutter_app/lib/features/camera/capture_pipeline.dart:1446-1472 — 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 (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) flutter_app/lib/features/camera/camera_config_sheet.dart:2234— flutter_app/lib/features/camera/camera_config_sheet.dart:2234-2254 | flutter_app/lib/features/gallery/gallery_screen.dart:1874-1888 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) flutter_app/lib/features/camera/capture_pipeline.dart:1285— flutter_app/lib/features/camera/capture_pipeline.dart:1285-1309 | flutter_app/lib/features/camera/capture_pipeline.dart:1507-1530 — 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, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) flutter_app/lib/features/camera/preview_renderer.dart:351— flutter_app/lib/features/camera/preview_renderer.dart:351-362 | flutter_app/lib/features/camera/preview_renderer.dart:364-376 | flutter_app/lib/features/camera/preview_renderer.dart:586-595 — 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 copies of one member (3 members, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) flutter_app/lib/features/camera/preview_renderer.dart:620— flutter_app/lib/features/camera/preview_renderer.dart:620-635 | flutter_app/lib/features/camera/preview_renderer.dart:654-669 | flutter_app/lib/features/camera/preview_renderer.dart:751-766 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×1
Edited copy of a member (8 corresponding lines) flutter_app/lib/features/camera/camera_notifier.dart:514— flutter_app/lib/features/camera/camera_notifier.dart:514-521 | REDACTED:628-637 — 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.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×1
Edited copy of a member (7 corresponding lines) flutter_app/lib/features/camera/camera_notifier.dart:763— flutter_app/lib/features/camera/camera_notifier.dart:763-771 | flutter_app/lib/features/camera/grd_camera_notifier.dart:194-200 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (49–53 lines × 2) REDACTED:5268— REDACTED:5268-5320 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1117-1165 — `REDACTED` and `flutter_app/lib/features/image_edit/image_edit_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 221 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:5268` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (39 lines × 2) REDACTED:2271— REDACTED:2271-2309 | REDACTED:3467-3505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2271` it begins part-way through the construct above it, so those exact lines 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–36 lines × 2) flutter_app/lib/features/camera/capture_pipeline.dart:1960— flutter_app/lib/features/camera/capture_pipeline.dart:1960-1993 | flutter_app/lib/features/camera/capture_pipeline.dart:2006-2041 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/capture_pipeline.dart:1960` it begins part-way through the construct above it, so those 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 (35 lines × 2) flutter_app/lib/features/camera/camera_config_sheet.dart:875— flutter_app/lib/features/camera/camera_config_sheet.dart:875-909 | flutter_app/lib/features/camera/camera_config_sheet.dart:917-951 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_config_sheet.dart:875` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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) REDACTED:4445— REDACTED:4445-4472 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1597-1624 — `REDACTED` and `flutter_app/lib/features/image_edit/image_edit_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 221 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4445` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) flutter_app/lib/features/camera/camera_config_sheet.dart:1937— flutter_app/lib/features/camera/camera_config_sheet.dart:1937-1960 | flutter_app/lib/features/camera/camera_config_sheet.dart:2611-2634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_config_sheet.dart:1937` it does not close everything it opens, so those exact lines 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) REDACTED:5209— REDACTED:5209-5230 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1071-1092 — `REDACTED` and `flutter_app/lib/features/image_edit/image_edit_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 221 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:5209` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–21 lines × 2) flutter_app/lib/features/camera/camera_config_sheet.dart:105— flutter_app/lib/features/camera/camera_config_sheet.dart:105-122 | flutter_app/lib/features/camera/camera_config_sheet.dart:422-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_config_sheet.dart:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) flutter_app/lib/features/image_edit/image_edit_screen.dart:1558— flutter_app/lib/features/image_edit/image_edit_screen.dart:1558-1578 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1644-1664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/image_edit/image_edit_screen.dart:1558` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 3) REDACTED:5201— REDACTED:5201-5219 | REDACTED:5530-5548 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1063-1081 — `REDACTED` and `flutter_app/lib/features/image_edit/image_edit_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 221 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:5201` it begins part-way through the construct above it, so those exact lines 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) REDACTED:5368— REDACTED:5368-5385 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1207-1222 — `REDACTED` and `flutter_app/lib/features/image_edit/image_edit_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 221 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:5368` it does not close everything it opens, so those 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) flutter_app/lib/features/camera/capture_pipeline.dart:628— flutter_app/lib/features/camera/capture_pipeline.dart:628-644 | flutter_app/lib/features/camera/capture_pipeline.dart:647-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 `flutter_app/lib/features/camera/capture_pipeline.dart:647` it begins part-way through the construct above it, so those 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, `flutter_app/lib/features/camera/capture_pipeline.dart:646` calls `debugPrint` and `flutter_app/lib/features/camera/capture_pipeline.dart: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 (15–17 lines × 2) flutter_app/lib/features/camera/camera_config_sheet.dart:180— flutter_app/lib/features/camera/camera_config_sheet.dart:180-194 | flutter_app/lib/features/camera/camera_config_sheet.dart:510-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_config_sheet.dart:180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) flutter_app/lib/features/camera/camera_config_sheet.dart:2346— flutter_app/lib/features/camera/camera_config_sheet.dart:2346-2360 | flutter_app/lib/features/camera/camera_config_sheet.dart:2557-2572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_config_sheet.dart:2346` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 3) REDACTED:5177— REDACTED:5177-5191 | REDACTED:5506-5520 | flutter_app/lib/features/image_edit/image_edit_screen.dart:1046-1058 — `REDACTED` and `flutter_app/lib/features/image_edit/image_edit_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 221 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:5177` it does not close everything it opens, so those 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) flutter_app/lib/features/camera/camera_config_sheet.dart:163— flutter_app/lib/features/camera/camera_config_sheet.dart:163-176 | flutter_app/lib/features/camera/camera_config_sheet.dart:492-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 `flutter_app/lib/features/camera/camera_config_sheet.dart:163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 2) flutter_app/lib/features/camera/camera_config_sheet.dart:243— flutter_app/lib/features/camera/camera_config_sheet.dart:243-254 | flutter_app/lib/features/camera/camera_config_sheet.dart:583-596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/lib/features/camera/camera_config_sheet.dart:243` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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) REDACTED:3393— REDACTED:3393-3403 | REDACTED:3513-3523 | REDACTED:3606-3616 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3393` it does not close everything it opens, so those 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–10 lines × 2) REDACTED:4879— REDACTED:4879-4884 | flutter_app/lib/features/camera/preview_renderer.dart:1307-1316 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4879` it does not close everything it opens, so those 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–8 lines × 3) flutter_app/lib/features/camera/camera_config_sheet.dart:121— flutter_app/lib/features/camera/camera_config_sheet.dart:121-127 | flutter_app/lib/features/camera/camera_config_sheet.dart:1654-1661 | flutter_app/lib/features/camera/camera_config_sheet.dart:1682-1688 — 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 `flutter_app/lib/features/camera/camera_config_sheet.dart:121` it does not close everything it opens, so those exact lines 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) REDACTED:3398— REDACTED:3398-3405 | REDACTED:3611-3618 | REDACTED:4642-4652 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3398` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 4) flutter_app/lib/features/camera/camera_config_sheet.dart:123— flutter_app/lib/features/camera/camera_config_sheet.dart:123-128 | flutter_app/lib/features/camera/camera_config_sheet.dart:444-449 | flutter_app/lib/features/camera/camera_config_sheet.dart:1657-1662 | flutter_app/lib/features/camera/camera_config_sheet.dart:1684-1689 — 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 `flutter_app/lib/features/camera/camera_config_sheet.dart:123` it does not close everything it opens, so those exact lines 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–39 lines × 2) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1054— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1054-1092 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1213-1246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1054` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 lines × 2) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1333— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1333-1349 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1815-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.
Duplicated block (6–7 lines × 2) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1743— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1743-1749 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1751-1756 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1743` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (3–6 lines × 4) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt:1033— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt:1033-1035 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt:1645-1647 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1760-1765 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1780-1785 — 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 (30 lines × 2) flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:785— flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:785-814 | flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:2978-3007 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:785` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (64–67 lines × 2) fix_luts_v2.py:28— fix_luts_v2.py:28-91 | generate_camera_luts.py:44-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17–23 lines × 2) fix_luts_v2.py:95— fix_luts_v2.py:95-111 | generate_camera_luts.py:114-136 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 after the matched lines, `fix_luts_v2.py:112` calls `join` and `generate_camera_luts.py:138` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (24–26 lines × 2) flutter_app/ios/Runner/Camera/CaptureProcessor.swift:506— flutter_app/ios/Runner/Camera/CaptureProcessor.swift:506-529 | flutter_app/ios/Runner/Camera/MetalRenderer.swift:521-546 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `flutter_app/ios/Runner/Camera/CaptureProcessor.swift:506` it does not close everything it opens, so those exact lines 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–18 lines × 2) flutter_app/ios/Runner/Camera/CameraSessionManager.swift:354— flutter_app/ios/Runner/Camera/CameraSessionManager.swift:354-371 | flutter_app/ios/Runner/Camera/CameraSessionManager.swift:396-406 — both copies are in the same file, so extract the 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–12 lines × 2) flutter_app/ios/Runner/Camera/CameraPlugin.swift:65— flutter_app/ios/Runner/Camera/CameraPlugin.swift:65-76 | native_plugin/ios/Classes/RetroCamPlugin.swift:11-16 — 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 `flutter_app/ios/Runner/Camera/CameraPlugin.swift: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.
Duplicated block (11–12 lines × 2) flutter_app/ios/Runner/Camera/MetalRenderer.swift:694— flutter_app/ios/Runner/Camera/MetalRenderer.swift:694-705 | native_plugin/ios/Classes/MetalRenderer.swift:179-189 — 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 `flutter_app/ios/Runner/Camera/MetalRenderer.swift:694` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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–8 lines × 3) flutter_app/ios/Runner/Camera/CameraSessionManager.swift:255— flutter_app/ios/Runner/Camera/CameraSessionManager.swift:255-262 | flutter_app/ios/Runner/Camera/CameraSessionManager.swift:264-271 | flutter_app/ios/Runner/Camera/CameraSessionManager.swift:272-276 — 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 `flutter_app/ios/Runner/Camera/CameraSessionManager.swift:255` it begins part-way through the construct above it, so those 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, `flutter_app/ios/Runner/Camera/CameraSessionManager.swift:264` calls `clampGains` and `flutter_app/ios/Runner/Camera/CameraSessionManager.swift:272` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (2–6 lines × 7) flutter_app/ios/Runner/Camera/CameraPlugin.swift:1767— flutter_app/ios/Runner/Camera/CameraPlugin.swift:1767-1768 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:1772-1775 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:1782-1783 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:1788-1793 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:1813-1814 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:1829-1834 | flutter_app/ios/Runner/Camera/CameraPlugin.swift:1861-1862 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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, `flutter_app/ios/Runner/Camera/CameraPlugin.swift:1859` calls `Float` and `flutter_app/ios/Runner/Camera/CameraPlugin.swift:1787` 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· Edited copies of one member (3 members, 15+ corresponding lines) · ×1
Edited copies of one member (3 members, 15+ corresponding lines) tools/generate_assets.py:95— tools/generate_assets.py:95-111 | tools/generate_assets.py:115-129 | tools/generate_assets.py:133-150 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×1
Edited copies of one member (3 members, 13+ corresponding lines) tools/generate_luts.py:48— tools/generate_luts.py:48-62 | tools/generate_luts.py:117-131 | tools/generate_luts.py:152-164 — 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 copies of one member (6 members, 3+ corresponding lines) · ×1
Edited copies of one member (6 members, 3+ corresponding lines) tools/generate_thumbnails.py:95— tools/generate_thumbnails.py:95-97 | tools/generate_thumbnails.py:100-102 | tools/generate_thumbnails.py:113-116 | tools/generate_thumbnails.py:119-121 | tools/generate_thumbnails.py:131-133 | tools/generate_thumbnails.py:136-139 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
Duplicated block (8–10 lines × 3) tools/generate_luts.py:54— tools/generate_luts.py:54-61 | tools/generate_luts.py:83-92 | tools/generate_luts.py:123-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.
Duplicated block (9 lines × 3) tools/generate_assets.py:95— tools/generate_assets.py:95-103 | tools/generate_assets.py:115-123 | tools/generate_assets.py:133-141 — 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, `tools/generate_assets.py:144` calls `ellipse` and `tools/generate_assets.py:125` 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.
No structured logging — No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.
Orphaned file flutter_app/lib/features/camera/camera_config_sheet.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/ios/Runner/Camera/CameraPlugin.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CaptureGLProcessor.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraGLRenderer.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/features/image_edit/image_edit_screen.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/features/camera/capture_pipeline.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/core/l10n.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/features/gallery/gallery_screen.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/models/camera_definition.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/features/camera/preview_renderer.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/ios/Runner/Camera/MetalRenderer.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/features/settings/settings_screen.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/services/camera_service.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/features/camera/capture_pipeline_ext.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/ios/Runner/Camera/CaptureProcessor.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/features/camera/camera_manager_screen.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/features/camera/camera_sample_screen.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/ios/Runner/Camera/CameraSessionManager.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/android/app/src/main/rs/capture_pipeline.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/models/preset.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file generate_camera_luts.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/tool/generate_artifact_textures.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/features/camera/device_calibration_profiles.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file flutter_app/lib/features/camera/grd_camera_notifier.dart:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Duplicated predicate REDACTED:2488— `_showExposureSlider || st.exposureValue != 0` appears character-identically in 2 files — REDACTED, flutter_app/lib/features/image_edit/image_edit_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate flutter_app/lib/features/camera/camera_notifier.dart:518— `camera == null || !camera.supportsLivePhoto` appears character-identically in 2 files — flutter_app/lib/features/camera/camera_notifier.dart, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:4319— `f.thumbnail != null && f.thumbnail!.isNotEmpty` appears character-identically in 2 files — REDACTED, flutter_app/lib/features/image_edit/image_edit_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:822— `rtLightIndex >= 0 || rtIso > 0 || rtExposureMs > 0` appears character-identically in 2 files — REDACTED, flutter_app/lib/features/camera/preview_renderer.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:823— `rtLightIndex >= 4.2 || (rtIso >= 800 && rtExposureMs >= 20) || (rtIso >= 1200 && rtExposureMs >= 12)` appears character-identically in 2 files — REDACTED, flutter_app/lib/features/camera/preview_renderer.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate flutter_app/lib/models/camera_definition.dart:34— `s == 'true' || s == '1' || s == 'yes' || s == 'on'` appears character-identically in 2 files — flutter_app/lib/models/camera_definition.dart, flutter_app/lib/services/retain_settings_service.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate flutter_app/lib/features/camera/camera_notifier.dart:809— `state.activeLensId == id && id != defaultLensId` appears character-identically in 2 files — flutter_app/lib/features/camera/camera_notifier.dart, flutter_app/lib/features/camera/grd_camera_notifier.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:3908— `title.startsWith('dazz_') || title.contains('dazz')` appears character-identically in 2 files — REDACTED, flutter_app/lib/features/gallery/gallery_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:3885— `upper == 'DAZZ' || upper.endsWith('/DAZZ') || upper.contains('DAZZ')` appears character-identically in 2 files — REDACTED, flutter_app/lib/features/gallery/gallery_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:4456— `wm.color != null && wm.color!.isNotEmpty` appears character-identically in 2 files — REDACTED, flutter_app/lib/features/image_edit/image_edit_screen.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate flutter_app/ios/Runner/Camera/CaptureProcessor.swift:511— `trimmed.hasPrefix("#") || trimmed.isEmpty` appears character-identically in 2 files — flutter_app/ios/Runner/Camera/CaptureProcessor.swift, flutter_app/ios/Runner/Camera/MetalRenderer.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate flutter_app/ios/Runner/Camera/CaptureProcessor.swift:519— `trimmed.hasPrefix("TITLE") || trimmed.hasPrefix("DOMAIN")` appears character-identically in 2 files — flutter_app/ios/Runner/Camera/CaptureProcessor.swift, flutter_app/ios/Runner/Camera/MetalRenderer.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D34 · Knowledge Freshness· Most significant orphaned file · ×3
Most significant orphaned file REDACTED:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file flutter_app/android/app/src/main/kotlin/com/retrocam/app/camera/CameraPlugin.kt:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file flutter_app/lib/features/camera/camera_notifier.dart:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
No ADRs found flutter_app/lib/main.dart:6— 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 `flutter_app/lib/main.dart` makes this repository a deployable product (line 6).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion flutter_app/pubspec.yaml:1— `flutter_app` (29180 LoC, 94 module-visible types across 11 directories) overshoots its size bounds. 1 of 6 build unit(s) (Gradle, Xcode, checkout, pub) overshoot their size bounds, lowering Project Cohesion to 6.7/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.
Dormant codebase — 61 of 61 significant files have no living knowledge — the codebase as a whole is dormant, not 61 separate risks. Counted over 61 of the 84 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. Re-engage owners or document before change.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No SAST REDACTED:6— No static application security testing detected. For this repository's stack, add the Dart analyzer's security lints plus `semgrep --config=auto` as a CI step. What was searched, so you can tell an absence from a miss: the 5 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No dependency-update automation flutter_app/android/app/build.gradle:45— `flutter_app/android/app/build.gradle` 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`.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Dart pubspec.yaml — not scanned yet).
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Dart pubspec.yaml — not scanned yet).
0
—
Run 01a1ea94-17ed-766e-b7a3-7fcc735e0192 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 28 · Warnings: 413 · Recommendations: 87 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 17:35 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.